Can't make JQuery's .show and .hide work -


i have problem using .show , .hide in jquery. want 2 options appear once hit register button, code:

html

<div id='register'>     <form>         <input type='button' class='register-button' name='register-button' value='r e g s t e r !'>     </form>     <form id='register-type'>         <span class='register-type-background'> </span>         <input type='button' class='register-type-band' name='register-type-band' value='band'>         <input type='button' class='register-type-user' name='register-type-user' value='user'>     </form> </div> 

jquery:

$(document).ready(function(){ $('#register-type').hide(); $('.register-button').click(function(){     $('#register-type').show();    }); }); 

and more html:

<head> <title> title </title> <link rel='stylesheet' href='stylesheet.css' type='text/css'> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> </script> <script type='script' src='javascript.js'> </script> </head> 

your code fine is, problem actual script reference:

<script type='script' src='javascript.js'> </script> 

there no type='script, needs type='text/javascript', change be:

<script type='text/javascript' src='javascript.js'> </script> 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -