Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About sanjog

  • Rank
  1. Hello, I created a button and have a checkbox form. I want to add that form one by one everytime when the button is clicked, I have tried by clone() method, it worked but the checkbox didn't work, i mean i couldn't check in the box or it checks in all of the form. I need help. Here is peice of my code... <html> <button id="check-type">Multiple choice</button> <div class="multiple-choice"> <input id="check1" type="checkbox" name="check" value="check1"> <label for="check1">ques1</label><br> <br> <input id="check2" type="checkbox" name="check" value="check2"> <label for="check2">ques2</label><br><br> </div> </html> <script> $('#check-type').click(function(){ $('.multiple-choice').show(); //shows only once, but i want to add this form everytime when the button is clicked. }); </script>
  2. I wanted to make a star rating system but my code is not working. Can anyone help me please? i couldn't figure out why the star is not changing while hover it. 1.0-star.png is white while 0.5-star.png is golden. Thanks. Here is the code.. <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script> function setRating(number){ jquery('#main').css('background', 'url(images/'+number+'-star.png) no-repeat') } function saveRating(number){ jquery('.rating').attr('onmouseout','setRating(''+number+'')'); alert(number); } </script> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="main" style="background:url(images/1.0-star.png) no-repeat;"> <div class="rating" onmouseover="setRating('0.5')" onclick="saveRating('0.5');" onmouseout="setRating('1.0')"></div> <div class="rating" onmouseover="setRating('1.0')" onclick="saveRating('1.0');" onmouseout="setRating('1.0')"></div> <div class="rating" onmouseover="setRating('1.5')" onclick="saveRating('1.5');" onmouseout="setRating('1.0')"></div> <div class="rating" onmouseover="setRating('2.0')" onclick="saveRating('2.0');" onmouseout="setRating('1.0')"></div> <div class="rating" onmouseover="setRating('2.5')" onclick="saveRating('2.5');" onmouseout="setRating('1.0')"></div> <div class="rating" onmouseover="setRating('3.0')" onclick="saveRating('3.0');" onmouseout="setRating('1.0')"></div> <div class="rating" onmouseover="setRating('3.5')" onclick="saveRating('3.5');" onmouseout="setRating('1.0')"></div> <div class="rating" onmouseover="setRating('4.0')" onclick="saveRating('4.0');" onmouseout="setRating('1.0')"></div> <div class="rating" onmouseover="setRating('4.5')" onclick="saveRating('4.5');" onmouseout="setRating('1.0')"></div> <div class="rating" onmouseover="setRating('5.0')" onclick="saveRating('5.0');" onmouseout="setRating('1.0')"></div> </div> </body> </html>
  • Create New...