Latest news:

New android application Islamic Video has been released. its a free islamic video application for android smartphone. Download now!

jQuery Set Content - text(), html(), and val()

We will use the same three methods from the previous page to set content:

  • text() - Sets or returns the text content of selected elements
  • html() - Sets or returns the content of selected elements (including HTML markup)
  • val() - Sets or returns the value of form fields

The following example demonstrates how to set content with the jQuery text(), html(), and val() methods:


    $("#test1").text("Hello world!");
    $("#test2").html("<b>Hello world!</b>");
    $("#test3").val("Dolly Duck");
Tags : jQuery,

Views : 3

Recent Posts


Popular Tags


Subscribe Us

Follow Us