TheFilmGod Posted April 6, 2009 Share Posted April 6, 2009 Using jquery, how can I select an element whose inner html is == 'login' $('#toolbar .header ul li a').text('login') Thanks! Quote Link to comment Share on other sites More sharing options...
irvieto Posted April 6, 2009 Share Posted April 6, 2009 in Jquery, the .html() method gives you the inner text. Example: <div id="hello">World!</div> <script type="text/javscript"> var div_content = $("#hello").html(); window.alert(div_content); /*displays: World!*/ </script> Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted April 8, 2009 Author Share Posted April 8, 2009 Thanks for the effort, but I'm not interested in obtaining the inner html. Instead, I'm interested in SELECTING an element according to the inner html value. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted April 8, 2009 Share Posted April 8, 2009 hope this helps: http://jquery-howto.blogspot.com/2009/01/how-to-select-innermost-element-with.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.