Using Jquery To Hide/unhide The Textbox If Button Is Clicked
I have input button , what I want is if a user clicks on the button then textbox should appear. Below is the code which is not working : ).toggle();
With no parameters, the .toggle()
method simply toggles the visibility of elements
Solution 2:
try this:
$(document).ready(function(){
$("#driver").click(function(){
$("#text").slideToggle("slow");
});
});
Solution 3:
Here's an example using toggle:
Solution 4:
<inputtype="submit" value="Add Second Driver" id="driver" />
<inputtype="text" id="text" style="display:none;" />
$("#driver").click(function() {
$('#text').css('display', 'block');
});
Solution 5:
$(function()
{
// Initially hide the text box
$("#text").hide();
$("#driver").click(function()
{
$("#text").toggle();
returnfalse; // We don't want to submit anything here!
});
});
Post a Comment for "Using Jquery To Hide/unhide The Textbox If Button Is Clicked"