Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set text in tag strong?

I wonder if I can set text or initial text in <strong> in javascript.

<!DOCTYPE html>
<html>
<body>
<script>
$(document).ready(function(){
// what should I do here?
}
</script>
<strong>Strong text</strong>
</body>
</html>

Thank you so much.

like image 571
barssala Avatar asked May 08 '14 06:05

barssala


1 Answers

Better to add a class or id to the html element as below :

JS :

$(document).ready(function(){
    $(".text").html("Your content here...");
});

HTML :

<strong class="text">Strong text</strong>

Demo : http://jsbin.com/cihilobe/1/

like image 109
Roy M J Avatar answered Sep 21 '22 13:09

Roy M J