-1

Suppose, problem 1: There's a cities drop-down list: 1) Lahore 2)Gujranwala 3)Islamabad Requirement is that: Gujranwala Should selected by default when page is loaded Problem 2: There's a class checklist: 1) Non-Technical 2)Technical 3)Creative Design Requirement is that: Technical should checked by default when page is loaded

Weather Vane
  • 33,872
  • 7
  • 36
  • 56
  • Possible duplicate of [How can I set the default value for an HTML – Weather Vane Oct 16 '19 at 14:27

1 Answers1

0

Add selected="selected" in the option that you want to be selected by default. For you example use this on Gujranwala.
and add checked in the input tag to make it checked by default.
Check and run the code snippet

<select>
  <option> One </option>
  <option> two </option>
  <option> three </option>
  <option> four </option>
  <option selected="selected"> five </option>
</select>
<br>

<input type="checkbox" checked> Checked
<br>

<input type="checkbox" > Unchecked