calling function on jquery selector

You should call the function, passing your element in as its object:

function doStuff() {
    alert( $(this).html() );
}

doStuff.call( $("#foo")[0] );

Due to the way we built and call doStuff, we can still use it as a callback on .each:

$(".bar").each( doStuff );

Fiddle: http://jsfiddle.net/jonathansampson/WuyJc/

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)