jqueryexample.com jQuery text() example - jqueryexample.com

jQuery text() example by jqueryexample

This tutorial will show you how to retrieving and setting text getting and setting text using jQuery.  jQuery text() function used to replace or set the text contents of all the matched elements.
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$("#divText").text("A dynamically set text");});
<div id="divText"> Text ABC ....</div>

Note: The .text() method cannot be used on form inputs or scripts. To set or get the text value of input or textarea elements, use the .val() method.

Did you like this? Share it:


No comments yet, be the first.

Leave a Comment