jQuery Event - live() Method
Example
When the button is clicked, hide or show the p element:
$("button").live("click",function(){ $("p").slideToggle(); });
Definition and Usage
The live() method attaches one or more event handlers to the selected elements and specifies the function to be executed when these events occur.
By live() method, event handlers attached through this method are applicable to current and future elements matching the selector (for example, new elements created by the script).
Syntax
$().live(event,data,function)
Parameter | Description |
---|---|
event |
অপশনাল।এলিমেন্টকে যুক্ত করা একটি বা একাধিক ইভেন্ট ইভেন্টগুলিকে স্পেস দিয়ে বিভক্ত করুন।ইভেন্টগুলি বৈধ হতে হবে |
data | অপশনাল।ফাংশনকে পাঠানো অতিরিক্ত ডাটা |
function | অপশনাল।ইভেন্ট ঘটার সময় চালু করতে হবে ফাংশন |
আরও ইনস্ট্যান্স
- ভবিষ্যতের এলিমেন্টগুলিতে ইভেন্ট হ্যান্ডলার যোগ করা
- কিভাবে live() মেথড ব্যবহার করে নিচের সৃষ্ট এলিমেন্টগুলিতে ইভেন্ট হ্যান্ডলার যোগ করা যায়