chordsoflife Posted January 19, 2009 Share Posted January 19, 2009 I'm looking to change an H2 tag when someone mouseover's a div that it contains. I haven't really spent the time with JQuery to even know exactly what it does, but I'm assuming it would be mad easy with it. Can anyone help me out? Thanks! Quote Link to comment Share on other sites More sharing options...
webster08 Posted January 20, 2009 Share Posted January 20, 2009 you don't need jQuery for this; it is very simple - see below..... <script type="text/javascript"> function madEasyTxtChange(whichOne,sayWhat) { document.getElementById(whichOne).innerHTML = sayWhat; } </script> <div style="width:auto;height:150px" onmouseover="madEasyTxtChange('heading2','New Header Content')"> <h2 id="heading2">Base Header Content</h2> </div> Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted January 20, 2009 Share Posted January 20, 2009 like webster said you dont need jQuery to do it or any javascript framework. If you do want do use jQuery here the example http://docs.jquery.com/Events/trigger#eventdata Quote Link to comment Share on other sites More sharing options...
chordsoflife Posted January 21, 2009 Author Share Posted January 21, 2009 Awesome, thanks guys, I really appreciate it. I need to take the time to learn JS. For real. I just love learning PHP too much. 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.