javascript - If checkbox in a form is ticked add it to the resulting div class -
i using wordpress plugin called multi rating pro. when user submits rating on page result appears in separate div on same page.
i want (as possible) insert own checkbox rating form , if ticked, output value in resulting div class.
for example, inside rating form add -
<input type="checkbox" name="anon" value="yes"> rate anonymously then in resulting div looking class of 'yes' added div if checkbox checked on submission, -
<div class="rating-result yes"></div> how go doing this? assume way in form submitted play part unsure of workings...
first provide id input, in case used anon. click here example
<input type="checkbox" value="yes" id="anon"><br/> <div class="rating-result"></div> $('#anon').click(function(){ var value = $('#anon').val(); $('.rating-result').html('your rating:' +' '+ value); })
Comments
Post a Comment