default

UK[dɪˈfɔ:lt] US[dɪˈfɔlt]

vi. Failure to perform tasks or responsibilities; failure to appear in court when summoned; failure to appear in court and lose the lawsuit; abstain

vt. Failure to perform, default; failure to participate or complete (for example, a competition); [Law] Lose (the lawsuit) due to failure to appear in court

n. Failure to perform, Default; [Law] failure to appear in court; abstention; [calculation] Default, default

Third person singular: defaults Present participle: defaulting Past tense: defaulted Past participle: defaulted

selected

英[sɪ'lektɪd] US[sɪ'lektɪd]

adj. By selection, selected

v. Select, select (select Past tense and past participle)

javascript defaultSelected attribute syntax

Function: Return the initial value of the selected attribute. Returns true if the default option is selected, fasle otherwise.

Syntax: optionObject.defaultSelected

javascript defaultSelected attribute example

<html>
<head>
	<meta charset="utf-8">
<script type="text/javascript">
function alertDefaultSelected()
  {
  var x=document.getElementById("mySelect").selectedIndex;
  var y=document.getElementsByTagName("option");
  var txt= y[x].text + " 是默认的水果吗? ";
  txt=txt + y[x].defaultSelected;
  alert(txt);
  }
</script>
</head>
<body>

<form>
选择你喜欢的水果:
<select id="mySelect">
  <option>Apple</option>
  <option>Orange</option>
  <option selected="selected">Pineapple</option>
  <option>Banana</option>
</select>
<br />
<br />
<input type="button" onclick="alertDefaultSelected()"
value="选择的水果是否是默认的?">
</form>

</body>
</html>

Run instance »

Click the "Run instance" button to view the online instance