I have this function toggles the disabled attribute form a input field:
$(\'.someElement\').click(function(){
if (someCondition) {
console.log($
UPDATED
DEMO: http://jsbin.com/uneti3/3
your code is wrong, it should be something like this:
$(bla).click(function() {
var disable = $target.toggleClass('open').hasClass('open');
$target.prev().prop("disabled", disable);
});
you are using the toggleClass function in wrong way
- http://api.jquery.com/toggleClass/