I would like to add some text just before the anchor tag I click on. The following adds the text to the actual anchor tag itself:
$(document).ready(function(){
$(".none_standard_links").live('click', function(event)
{
event.preventDefault();
$(this).prepend("test");
});
});
the above gives me html as shown below:
Before the link is clicked
<a href="#" class="none_standard_links">link one</a>
After the link is clicked
<a href="#" class="none_standard_links">testlink one</a>
What I want is this:
test<a href="#" class="none_standard_links">link one</a>
You can use
before:Live example