$(document).ready(function () {
$("p").text("The DOM is now loaded and can be manipulated.");
});
Code language: JavaScript (javascript)
$("p").bind("click", function(e) {
var str = "( " + e.pageX + ", " + e.pageY + " )";
$("span").text("Click happened! " + str);
});
$("p").bind("dblclick", function() {
$("span").text("Double-click happened in " + this.tagName);
});
$("p").bind("mouseenter mouseleave", function(e) {
$(this).toggleClass("over");
});
Code language: JavaScript (javascript)
trigger( event, data ) Trigger an event on every matched element. This will also cause the default action of the browser with the same name (if one exists) to be executed. For example, passing ‘submit’ to the trigger() function will also cause the browser to submit the form. This default action can be prevented by returning false from one of the functions bound to the event. Triggered events aren’t limited to browser-based events, you can also trigger custom events registered with bind. $("button:first").click(function () {
update($("span:first"));
});
$("button:last").click(function () {
$("button:first").trigger('click');
update($("span:last"));
});
function update(j) {
var n = parseInt(j.text(), 10);
j.text(n + 1);
}
Code language: JavaScript (javascript)
$("li").hover(
function () {
$(this).append($("<span> ***</span>"));
},
function () {
$(this).find("span:last").remove();
}
);
Code language: JavaScript (javascript)
$("input").blur(function () {
$(this).next("span").css('display','inline').fadeOut(1000);
});
Code language: JavaScript (javascript)
$("input").blur(function () {
$(this).next("span").css('display','inline').fadeOut(1000);
});
Code language: JavaScript (javascript)
$("select").change(function () {
var str = "";
$("select option:selected").each(function () {
str += $(this).text() + " ";
});
$("div").text(str);
})
.change();
Code language: JavaScript (javascript)
$("p").click(function () {
$(this).slideUp();
});
$("p").hover(function () {
$(this).addClass("hilite");
}, function () {
$(this).removeClass("hilite");
});
Code language: JavaScript (javascript)
var divdbl = $("div:first");
divdbl.dblclick(function () {
divdbl.toggleClass('dbl');
});
Code language: JavaScript (javascript)
$("input").keypress(function (e) {
if (e.which == 32 || (65 <= e.which & e.which <= 65 + 25)
|| (97 <= e.which && e.which <= 97 + 25)) {
var c = String.fromCharCode(e.which);
$("p").append($("<span/>"))
.children(":last")
.append(document.createTextNode(c));
} else if (e.which == 8) {
// backspace in IE only be on keydown
$("p").children(":last").remove();
}
$("div").text(e.which);
});
Code language: JavaScript (javascript)
$("p").mouseup(function(){
$(this).append('<span style="color:#F00;">Mouse up.</span>');
}).mousedown(function(){
$(this).append('<span style="color:#00F;">Mouse down.</span>');
});
Code language: JavaScript (javascript)
$("p").clone().appendTo(document.body);
$("p").clone().appendTo(document.body);
$("p").clone().appendTo(document.body);
$(window).scroll(function () {
$("span").css("display", "inline").fadeOut("slow");
});
Code language: JavaScript (javascript)
Java URL Encoder/Decoder Example - In this tutorial we will see how to URL encode/decode…
Show Multiple Examples in OpenAPI - OpenAPI (aka Swagger) Specifications has become a defecto standard…
Local WordPress using Docker - Running a local WordPress development environment is crucial for testing…
1. JWT Token Overview JSON Web Token (JWT) is an open standard defines a compact…
GraphQL Subscription provides a great way of building real-time API. In this tutorial we will…
1. Overview Spring Boot Webflux DynamoDB Integration tests - In this tutorial we will see…
View Comments
The browser is going to be the OS of Web 2.0 and beyond. How can Google let someone else have control of the market without making any effort to enter it. But this is definitely a project which has been very successful in keeping itself secret. Everybody knew about Gphone http://www.frogmix.com/search/Gphone before Andriod was released . But chrome was nowhere to be heard of before Philipp Lensenn received the comic book.
I have found custom jquery events extremely useful!
Thank you, do you know if jQuery events can be hooked to .NET Web browser control?