$(this) Selector in jQuery

$(this) – selector is used to select the current element in the page.

Syntax : $(this) Selector in jQuery

$(this) Selector in jQuery Example

<!DOCTYPE html>
<title>jQuery $(this) Example</title>
 <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js">
<script type="text/javascript">
          $(this).css("border","4px solid red");
          alert("You Invoked me And all properties are applied using $(this) reference");
<a href="javascript:void(0)" id="demo"> 
Click this element to invoke me..


Try it »


Add Comment

📖 Read More