jQuery - Insert content at the beginning of element with prepend()

0 votes
232 views
added Aug 8, 2019 in jQuery by LC Marshal Captain (25,790 points)
edited Aug 9, 2019 by LC Marshal
// Insert content at the beginning of all paragraph that has .classy CSS class elements
$('.clickme').click(function(){
  $('p.classy').prepend("<b>Prepended text ges here</b>");
});

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...