Posts

Showing posts with the label dropdown javascript

Trim Dropdown Options Using JQuery

This is the HTML of my dropdown list. I have whitespace before and after each of option for this select/ dropdown. And here is a easy way to trim these option values using jQuery each method and javascript trim method. ajab prem Ki Gajab Kahani ajab prem Ki Gajab Kahani

select option in dropbox through javascript

If you want to select an option in your Dropdown box as you select that option from a link. Here is solution...... I have used the code with onclick event you r free to use at any event. Put this into Head section: <script> function setdate(num) { //alert(num); document.f1.approxdate[num].selected=true; } </script> Put this into Body section: <form name="f1" id="f1" > <select name="selSS1" id="approxdate"> <option value="0">ha ha ha</option> <option value="1">hi hi hi</option> <option value="2">hu hu hu</option> <option value="3">he he he</option> <option value="4">ho ho ho</option> </select> <br /><br /> <a href="javascript:void(0);" onclick="javascript:setdate(0)">ha ha ha</a> <br /> <a href="javascript:vo...