$().ready(function()
{
$("#add").click(function()
{
var vals = $("#txtaddfeature").val();
if(vals !='')
$('#FeatureLists').prepend('<option value="' + vals + '" selected="selected">' + vals + '</option>');
$('#txtaddfeature').val('');
});
});
Ok after adding the value to the select list as above
$('#FeatureLists').prepend('<option value="' + vals + '" selected="selected">' + vals + '</option>');
I want to create a dynamic hidden field with id=vals defined above and set it value to value entered in the textbox . how can i do that
$().ready(...)probably shouldn't be used if you have jQuery 1.4 since$()no longer returns a jQuery object with thedocument. Instead, do$(document).ready(...), or just$(function() {...}).