Can I pass the button ID dynamically?
$('#Button1').focus(function () {
if (document.getElementById('HiddenVal').value != null && document.getElementById('HiddenVal').value != '') {
$('#txtbox1').val(document.getElementById('HiddenVal').value);
$('#Button1', window.parent.document).css("background-color", "#fcc63b");
document.getElementById('HiddenVal').value = '';
}
});
Here I want to pass the button ID dynamically instead of using $('#Button1').
Can I use that?
yes you can- place your code inside a function…and pass id as a parameter to that function – like this..