1

I have the following strange behaviour:

<select name="blah" id="blah" size="1" onclick="console.log('clicked');">
    <option>test</option>
    <option>test</option>
</select>

Doesn´t fire when clicked the first time (when opening). It fires when I click a second time and the select element closes. Why?

Edit: added example options to select.

Here: http://jsfiddle.net/e5x63, I have three different behaviours on three different browsers (Chrome, Safari and Firefox) with this and also on different OS!

chris
  • 600
  • 7
  • 21

1 Answers1

0

If you want to bind event on changing any value from drop down.

<select name="bla" id="blubb" size="1" onclick="console.log('test')" onchange="console.log('value Changed')">
     <option>1</option>
     <option>2</option>
</select>
Dharam Mali
  • 907
  • 1
  • 11
  • 24