Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

javascript help


amritanan

Question

Hi,

I'm not a javascript girl, but I am trying to write some code to hide/display sections when clicking on different buttons. My question is how can I get an array of all the section ids on a page?

It was easy to hide/display sections when I knew the section ids, but I want to create it without hardcoding the section ids so that the client can use it as a template. 

Thank you!

Link to post
  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Popular Posts

Hi, I'm not a javascript girl, but I am trying to write some code to hide/display sections when clicking on different buttons. My question is how can I get an array of all the section ids on a pa

Thank you! I was trying to create "tabs" on a page - I first thought I would need to get all the section ids, but I was able to do it using the nth-of-type selector for the sections. For example

2 answers to this question

Recommended Posts

  • 0
4 hours ago, amritanan said:

Hi,

I'm not a javascript girl, but I am trying to write some code to hide/display sections when clicking on different buttons. My question is how can I get an array of all the section ids on a page?

It was easy to hide/display sections when I knew the section ids, but I want to create it without hardcoding the section ids so that the client can use it as a template. 

Thank you!

Without the name (unique id) it's hard to know which is the section to hide, could you share more detail about your ideas?

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Animated Heading Block
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to post
  • 0
On 3/22/2021 at 8:53 PM, bangank36 said:

Without the name (unique id) it's hard to know which is the section to hide, could you share more detail about your ideas?

Thank you! I was trying to create "tabs" on a page - I first thought I would need to get all the section ids, but I was able to do it using the nth-of-type selector for the sections.

For example - on Button 1 click - show section 2, hide sections 3 and 4.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...