Click on the menu to highlight the effect:
$ (function () {
$ ("#asideNavUl li"). Click (function () {
$ ("li[class= ' on ']"). Removeattr ("class");
$ (this). AddClass ("on");
});
});
Or
$ (function () {
$ ("#nav li"). Click (function () {
$ ("li[class= ' arrow_on ')"). Removeattr ("class");
$ (this). addclass ("arrow_on");
});
});
Radio JS Interaction:
$ (' #checkbox '). On (' click ', function () {
if (!$ (). Is (': Checked ')) {
$ (this). Parent (). Removeclass (' checkbox '). addclass (' checkboxdisabled ');
}else{
$ (this). Parent (). Removeclass (' checkboxdisabled '). addclass (' checkbox ');
}
});
Toggle
$ ("#detailBtn"). Click (function () {
$ ("#timeShowLine"). Toggle ("Slow", function () {
$ (this). addclass ("Processconcur");
$ (this). Removeclass ("Processcon");
},function () {
$ (this). Removeclass ("Processconcur");
$ (this). addclass ("Processcon");
})
})
Clear the input default value:
Window.onload = function () {
var input = document.getElementById ("input");
Input.onblur = function () {
This.value = (This.value = = ""? this.defaultValue:this.value);
};
Input.onfocus = function () {
This.value = (This.value = = This.defaultvalue?) ": This.value);
};
};
Or
Window.onload = function () {
var input = document.getElementById ("input");
Input.onfocus = function () {
if (This.value==this.defaultvalue) {
This.value= ";
This.style.color= "#000";
}
else this.style.color= "#999";
};
Input.onblur = function () {
if (this.value== ') {
This.value=this.defaultvalue;
This.style.color= "#999";
}
else this.style.color= "#000";
};
};
JS Common Code