I am trying to use a piece of code that enables and disables textboxes on a button click. Someone has solved this previously enable and disable textbox by using button click . Their Demo works exactly the way I want but when I copy and paste the exact code onto my html it doesn't work. I even tried pasting it into a completely blank html page and it still doesn't work.. Any ideas why? Thanks.
Wilfredo P's code ---
$(document).ready(function(){
$('#disablebutton').click(function(){
if($('#textfieldToClose').prop('disabled'))
{
$('#textfieldToClose').prop('disabled', false)
}
else{
$('#textfieldToClose').prop('disabled', true)
}
});
})