Saturday 13 January 2018

javascript - Show/hide input field based on checkbox





If the checkbox is clicked it will display an input field... so far
it it is working, But if the checkbox is unchecked it should hide it, how can i do it?




             class="checkbox"> 




class="input" id="descripcion">

for="exampleInputEmail1">Descripcion
type="textarea" rows="7" cols="" class="form-control" name="descripcion" placeholder=""
required>




Here is
the script



             type="text/javascript">
$(document).ready(function () {

$("#descripcion").hide();

$("#clases").click(function ()
{
$("#descripcion").show();
});
});



class="post-text" itemprop="text">
class="normal">Answer




$("#clases").change(function ()
{

$("#descripcion").toggle();
});



No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...