javascript - If the Option Value is having value="0" alert true -


demo

html:

<select>     <option value="0">this 0 </option>     <option value="1">this 1 </option>     <option value="2">this 2 </option>     <option value="3">this 3 </option> </select> 

js:

$(function () {     if ( $("select option[value='0']") == option[value='0'] ) {         alert('asd')     } }) 

 <select id='myselect'> 

js:

var  selectedvalue=document.getelementbyid('myselect').value; if(selectedvalue=='0') alert('asd'); 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -