javascript - jquery function works after single space in quotes -


i learning jquery , new it. trying run code not running , found need give 1 space before ending double commas/quotes "

$("div:not([id=header]) " + strwhichtag).each(function(){     //some function           }); 

now question why need give space after id=header]) if remove space , use code, doesn't work, code below doesn't work why

$("div:not([id=header])" + strwhichtag).each(function(){     //some function           }); 

changes------------------------ strwhichtag h3 not child #header

second thing need know this

var olist = $("<ul id='bookmarkslist'>"); 

here can use single quotes , double quotes alternatively or need keep same level using double quotes , use sigle quotes inside them

i learning appriciated

lets

var strwhichtag = 'span';  $("div:not([id=header])" + strwhichtag) 

evaluates $("div:not([id=header])span") // no tag div , span equivalent

but if same $("div:not([id=header]) span") .. try find spans inside div tag not have given id


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -