vendredi 1 juillet 2016

Display text when input tag checkbox is selected

I am trying to display a text when the user selects the input tag,

For example, I have the following code:

<tr>
    <td class="align">
        Yes <br/>
        <input type="checkbox" />
    </td>
</tr>

Once the user clicks on the check box, the following text will appear:

"If you have selected yes,....."

And I am not sure if JavaScript would be the best path to do this.

But, If it is, would it be something like:

<script>
    $(function(){ 
         if(input was checked)//not sure what would go here, new to Javascript
             display results//not sure either, new to Javascript
    });
</script>




Aucun commentaire:

Enregistrer un commentaire