I have written a very simple script with jQuery, but it does not work in Firefox:
<a href="" class="po">any text</a>
<form>
<input type="text" class="infobox" />
<br />
<textarea class="me"></textarea>
<input type="submit" value="click" class="submit" />
</form>
jQuery
var vl = $('.po').text();
$('.po').click(function(){
$('.me').val(vl);
});
Why does this script not work in Firefox?
Thanks in advance
$(".po")is a link, so you should useevent.preventDefault()orreturn falseso you don’t navigate away from the page when you click it.Also make sure you are using
scripttagsTry it out with this jsFiddle
Or, you can put the JS in the head like this:
Try it out with this jsFiddle