document.getElementById('next').style.visibility="hidden";
document.getElementById('button').onclick = function() {
var a = document.getElementById('num1').value;
var b = document.getElementById('num2').value;
var count = parseInt(a, 10) + parseInt(b, 10);
if(count>=3){
document.getElementById('next').style.visibility="visible";
};
};
//IE polyfill
(function () {
if ( typeof window.CustomEvent === "function" ) return false;
function CustomEvent ( event, params ) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent( 'CustomEvent' );
evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
return evt;
}
CustomEvent.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent;
})();
window.dispatchEvent(new CustomEvent('resize'));
Note: This method signature was deprecated in jQuery 1.8 and removed in jQuery 1.9. jQuery also provides an animation method named .toggle() that toggles the visibility of elements. Whether the animation or the event method is fired depends on the set of arguments passed.
var textarea = 'for (var i = 0; i < 5; i++) { document.write("Привет, мир" + "<br>"); }';
eval(textarea);
text_result = document.getElementsByTagName('body')[0].innerHTML;
MyPerfectNameForObj = function () {
currentWins: function () {
var wins = cookie('wins'); //сохраним результат сразу вместо того, чтобы запрашивать 2 раза
if (wins > 1) {
this.counter = wins;
} else {
this.counter = 1;
}
}
}
MyPerfectNameForObj.currentWins();
MyPerfectNameForObj.counter; // получить доступ к counter