Triggering Element Logic
Triggering Element Logic
I have bound functions to certain element events, which contain logic which decides whether or not other elements are hidden/visible. Such as the code below:
- $("#menu_include").change(function() {
if ($(this).attr('checked')==true) {
$("#menu_order").parent().show();
}
else
{
$("#menu_order").parent().hide();
}
Pretty straight forward. I tick the menu_include checkbox and something else is hidden.
What I'd like to know is: is it possible to trigger this logic upon the page opening of the page, so that the menu_order element is visible/no-visible if the menu_include checkbox is ticked, without retyping the code elsewhere?