Get label value:
$('#Label1').text();
Set label value:
$('#Label1').text("New Value");
Get Textbox value:
$('#TextBox1').val();
Set Textbox value:
$('#TextBox1').val("New Value");
Get Dropdown value:
$('#DropDownList1').val();
Set Dropdown value:
$('#DropDownList1').val("New Value");
Get text of selected item in dropdown:
$('#DropDownList1 option:selected').text();
Get Checkbox Status:
$('#CheckBox1').attr('checked');
Check the Checkbox:
$('#CheckBox1').attr('checked',true);
Uncheck the Checkbox:
$('#CheckBox1').attr('checked',false);
Get Radiobutton Status:
$('#RadioButton1').attr('checked');
Check the RadioButton:
$('#RadioButton1').attr('checked',true);
Uncheck the RadioButton:
$('#RadioButton1').attr('checked',false);
Disable any control:
$('#TextBox1').attr('disabled', true);
Enable any control:
$('#TextBox1').attr('disabled', false);
Make textbox read only:
$('#TextBox1').attr('readonly', 'readonly');
$('#Label1').text();
Set label value:
$('#Label1').text("New Value");
Get Textbox value:
$('#TextBox1').val();
Set Textbox value:
$('#TextBox1').val("New Value");
Get Dropdown value:
$('#DropDownList1').val();
Set Dropdown value:
$('#DropDownList1').val("New Value");
Get text of selected item in dropdown:
$('#DropDownList1 option:selected').text();
Get Checkbox Status:
$('#CheckBox1').attr('checked');
Check the Checkbox:
$('#CheckBox1').attr('checked',true);
Uncheck the Checkbox:
$('#CheckBox1').attr('checked',false);
Get Radiobutton Status:
$('#RadioButton1').attr('checked');
Check the RadioButton:
$('#RadioButton1').attr('checked',true);
Uncheck the RadioButton:
$('#RadioButton1').attr('checked',false);
Disable any control:
$('#TextBox1').attr('disabled', true);
Enable any control:
$('#TextBox1').attr('disabled', false);
Make textbox read only:
$('#TextBox1').attr('readonly', 'readonly');
0 comments:
Post a Comment