In jQuery, the “empty” selector is used to select all elements that have no children (including any text inside). Examples <div class="div-class1"> This is div-class1 </div> <div class="div-class2" /> $(‘:empty’) – The “div-class2” is matched, while the “div-class1” is not. jQuery Example A simple example to show the use of the jQuery “empty” selector. <html> […]

Read more jQuery – Empty selector example

jQuery adjacent sibling selector (X + Y) is used to select the immediately follow or next elements matched by “Y” that is a sibling of a “X” element. For example, <div class="class1"></div> <p>I’m class1 sibling #1</p> <p>I’m class1 sibling #2</p> <p>I’m class1 sibling #3</p> The <div> and <p> are sibling relationship. The “$(.class1 + p)” […]

Read more jQuery – Adjacent sibling selector example

The :first-child is used to select all elements that are the first child of their parent, which is a shorthand for :nth-child(1). Examples $(‘li:first-child’) – selects all elements matched by <li> that are the first child of their parent. $(tr:first-child’) – selects all elements matched by <tr> that are the first child of their parent. […]

Read more jQuery – First child & last child selector example

The following code is a JQuery javascript which will refresh the captcha image automatically wherever user clicked on it. The code is working fine in FireFox. However, when i test it in Internet explorer 6 or 7, i hit the following Active X controls warning. Your security settings do not allow Web sites to use […]

Read more JQuery hit Internet Explorer ActiveX controls warning? – Solution

Since WordPress version 2.x, jQuery is a build-in Javascript library, explicitly include the jQuery library into WordPress is not necessary. Problem The jQuery is not working in WordPress plug-in writing? When you try to test a simple jQuery effect like following $(document).ready(function(){ alert(‘test’); }); It’s just not working, no alert message box pop up. The […]

Read more JQuery is not working in wordpress – Solution