jQuery: if value is true without user action
- by Kevin Brown
I want to show a div if the value of an input =='CP'.
Right now this is my code:
$(".register-type").change(function(){
var value = $(this).val();
if(value == 'CP'){
$('.cp-show').show();
This works fine if they change the input, but if things get validated false and the page reloads, this input is still 'CP', but the div doesn't show...
Is there a way to correct this so that jquery checks if this is set on the page load?