Answer:
Generally in jQuery val() method is used to set the value of an attribute which is called on any <input> elements. How ever if it is called on <select> with the <option> value then the passed option would be selected.
Say if it is called on Checkbox or Radiobutton then all the matching Checkboxes and Radiobuttons would be checked.
Asked In: Many Interviews |
Alert Moderator