javascript - How to pass text of clicked object to variable -
so want text fro of clicked , passed variable, echoing variable a.
this far have gotten, though doesn't work. how should this?
var aonetext = $(clickeda).text(); $('a.one').click(function(){ var clickeda = $(this); $('a.two').text(aonetext); });
you not assigning text aonetext in event.
var aonetext; $('a.one').click(function(){ var clickeda = $(this); aonetext = clickeda.text(); $('a.two').text(aonetext); });
Comments
Post a Comment