Javascript examples for String Operation:String Character
Illegal character error in jquery
<html> <head> <script src="https://code.jquery.com/jquery-1.7.1.min.js"></script> <script> $(document).ready(function(){ $('button').click(function(){ var rname = 1; /*from w ww . java 2 s . co m*/ console.log($("#presetname-"+rname+" option:selected").text()); }); }); </script> </head> <body> <select id="presetname-1"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> <button>Get</button> </body> </html>