Thursday 15 July 2010

clone - jquery, display on hover text from a in p -


Sorry for the dumb question, but jquery im im so much My code looks like this:

  & lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; & Lt; / A & gt; Link 1 & lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; & Lt; / A & gt; Link 2 & lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; & Lt; / A & gt; Link 3 & lt; / Li & gt; & Lt; / Ul & gt; & Lt; P & gt; & Lt; / P & gt; $ ("A") Hover (function () {var ind = $ (this) .val (); $ ("p"). Text (ind)});   

I want to show one in the hover text from my paragraph. Probably a big piece of nonsense code please help me ...

use .text ( ) instead of .val ()

In addition to this you have text inside li , you

  & lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Link 1 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Link 2 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Link 3 & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt;   

JS:

  $ ("a"). Hover (function () {var ind = $ (this) .text (); $ ("p"). Text (ind)});   

Demo ----->

No comments:

Post a Comment