Im working with the following code;
<a href=\"#\" onClick=\"if($(this).next('div').css('display') == 'none') { $(this).next('div').show('fast'); } else { $(this).next('div').hide('fast'); } return false;\">Link</a>
What i need to do, is change the part if($(this).next('div'), to target a specific element ID, not the next one from current location.
Any ideas are much appreciated, as well as explinations.
Thanks in advance.
You can use
$('#myDiv')to select an element withid="myDiv". Also, you should be using thetogglefunction for this: