Hello people, I'm new to this forum. I was a member of stack overflow for a while, but the account eventually got suspended for what they thought was a mis-use of information - because of that harsh environment, I google'd an alternative. This seems like a brilliant one.
Basically, when it comes down to the crunch - I really do consider myself a Designer and not a Developer. Although my skills are adequate(especially now I've noticed I can code better than I can spell 'adequate' - I got there on the fifth attempt). So, anyway this post - Some of the ways you can use the Javascript/jQuery selector and one I'm not familiar with, at all.
so, we have the body and container elements;
Code:
<body>
<div id="container"></div>
</body>
and we need to manipulate the DOM, specifically the container ID;
#1
Code:
$('#container').append("The first insance");
#2
Code:
$('body > div').append("The Second Instance");
#3
Code:
$('body #container').append("The Third Instance");
#4
Code:
$('div#container').append"(The Final Instance");
OK, so you're probably thinking "There's more than that." ....
.
#2 is structure dependant - the selector is assuming you have
Code:
<div id="container">The First Instance</div>
directly below the body tag. If you do not, the selector will return the div that is.
So, we may or may not know that the variations are available because each one will suit the needs which the page requires and some can be a benefactor for speed.
but, what is this?
var is a stored variable of sorts. if you are familiar with this syntax, you can probably use your imagination to complete the variable.
anyway, thanks for reading. I'm usually a silent stalker of code, I pulled out something relatively mondane, making the effort for my introduction, 'yano?
Thank you.
.
Bookmarks