P
pbd22
Hi.
I have recently been looking at the source of a number
of sites and I have noticed that while elements on a
page do not have an onclick attribute, they fire JavaScript
behavior. For example, if I click on any of the below "options",
something happens (that depends on the value of the option
I clicked on).
How is this done without using an onclick attribute (pls. excuse
my newbieness). Could somebody illustrate (code appreciated)
how I can grab the value of the option clicked on?
<select id=sel1 name=sel1>
<option value="234">Option1</option>
<option value="235">Option2</option>
<option value="236">Option3</option>
<option value="237">Option4</option>
<option value="238">Option5</option>
<option value="239">Option6</option>
</select>
Thanks in advance.
I have recently been looking at the source of a number
of sites and I have noticed that while elements on a
page do not have an onclick attribute, they fire JavaScript
behavior. For example, if I click on any of the below "options",
something happens (that depends on the value of the option
I clicked on).
How is this done without using an onclick attribute (pls. excuse
my newbieness). Could somebody illustrate (code appreciated)
how I can grab the value of the option clicked on?
<select id=sel1 name=sel1>
<option value="234">Option1</option>
<option value="235">Option2</option>
<option value="236">Option3</option>
<option value="237">Option4</option>
<option value="238">Option5</option>
<option value="239">Option6</option>
</select>
Thanks in advance.