...

View Full Version : Very Simple Question about a JS link, but Im pulling my hair out!



BlackReef
07-18-2012, 05:49 PM
On the surface it looks simple, but here is my question.

I want to use this CSS button to replace the 'here' text in the bottom script:

Here is the button code itself:

<a href="#" class="read_more3">Full Specification Sheet</a>


And here is the script I want to happen when you click on the button. Right now this works, but only if click on the plain text 'here':

<a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display ='block'">here</a>


Thanks in advance!!!

Old Pedant
07-18-2012, 08:32 PM
<a href = "#" class="read_more3"
onclick = "document.getElementById('light').style.display='block';
document.getElementById('fade').style.display='block';
return false;">
Full Specification Sheet
</a>

The key is return false. Without that, the <a> tries to do its normal operation.

BlackReef
07-18-2012, 11:37 PM
Thank You Sir



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum