when i click on anchor i need to enable text field
I have a anchor tag, with id="click_me". When i click on this i should enable input text (<input type="text" id="summary" class="summary">
), which is disabled first.
even i can do it using javascript function, by calling these javascript function() using onclick in the tag; but in my application i shld not use these.
I am newbie to php. please suggest me any alternative solution either using DOM or anything else. Thanks i开发者_如何学JAVAn advance
jQuery:
$('#click_me').click(function() { $('select-your-input-element-here').attr('disabled',''); });
$("#click_me").toggle(
function ()
{
$('#your_input_box').attr("disabled", true);
},
function ()
{
$('#your_input_box').removeAttr("disabled");
});
would possibly do the trick in jquery.
Having this somewhere in your <head>
section will work:-
<script>
$(document).ready( function() {
$('#click_me').click( function() {
$('#textarea').removeAttr("disabled");
};
});
</script>
精彩评论