This is a shortcut for:
$(document).ready(function makeFooWriteTooltip() {
Although the function here should not have a name. Passing calback into the $()function starts in the event document.ready, a little shorter, this is equivalent:
$(document).ready(function() {
});
$(function() {
});
Also, given your exact example, there is no need to check .lengthif it works there, if it doesn’t .each()do anything (without errors), so this would be enough:
$(function () {
$("div[name='txttooltip']").each(function(){
source
share