Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get href to follow a link when using jQuery

I'm having trouble getting <a href="#"> to follow the link when jQuery is activated.

<ul>
    <li class="menuOption"><a href="#"></a>Home</li>
    <li class="menuOption"><a href="#"></a>About</li>
</ul>

I looked at a few posts but they involve people trying to prevent a link being followed by using preventDefaults(); in the .js file. I'm not sure what my solution would be.

like image 925
vitamike Avatar asked Dec 08 '25 00:12

vitamike


1 Answers

You Need to put the link text inside of the anchor tags. Right now, the a tag is empty and so therefore un-clickable.

Try this instead:

<ul>
    <li class="menuOption"><a href="#">Home</a></li>
    <li class="menuOption"><a href="#">About</a></li>
</ul> 
like image 199
Jonathan P Avatar answered Dec 10 '25 14:12

Jonathan P



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!