Articles → JQUERY → Ready Function In Jquery
Ready Function In Jquery
Prerequisite
- Hands on experience in creating HTML page.
- Basic knowledge of JavaScript.
- Basic knowledge of event handling in JavaScript.
Introduction
Syntax
$(document).ready(function() {
// Add your code here
});
Adding Events In $(Document).Ready()
<a href='#' onclick="javascript:alert('this is the click event');">Click Me</a>
$(document).ready(function() {
$('a').click(function() {
alert("you clicked me!");
});
});