i am a learner of javascript. so first i don’t want to use jquery to get the tab. the above is my code. but it doesn’t work.how to correct my code. thank you.
i want to when click one then show content one.all the content are hidden. two then show content two…
The standard technique for that is for the script to first hide all of the content, and to then show the one that the clicked link refers to.
Typically the second part is achieved by having a link that goes to a fragment identifier, such as “#content1” and to have a div with the same value as its identifier: id=“content1”
But basically, it’s how you tell the web browser that you want to scroll the page down to the part of the page that has that identifier.
How it can be used with scripting, it to disable the default web browser behaviour, and to instead use the fragment identifier from the link as a way to identify the area of interest, in this case that would be showing the related content area, after first hiding them all.