How to write Jasmine Script
I have some check boxes in my JSP page and also same number of 'div'
elements.
If the check box is checked corresponding div should be visible and
remaining `divs should be hidden.
For example if checkbox (id='first') is checked then div (id='divFirst')
should be visible and so.
my JQuery code is:
$("input[name='category']:checkbox").click(function () {
var av = document.getElementsByName('category');
for (var e = 0; e < av.length; e++) {
var divName = "#div" + av[e
}.id;
if (av[e].checked == true) {
$(divName).show();
} else {
$(divName).hide();
}
}
}
this is my jquery` code which hides/shows division of page depending on
check boxes.
But I need to write Jasmine script to test it and I am new to Jasmine
script. So could any one please tell me how to write Jasmine Script for
this to test it.
No comments:
Post a Comment