Don't use dropdown lists? Every other shopping site uses divs for each computer that display all the information for that computer and use checkbox to choose which one.
I understand if you don't yet think like a programmer and need help on logic problems. But I don't want you to get dependant on me for asking how Javascript statements work when you can read it off a...
It will exit when the stuff in the brackets after the keyword 'while' resolves to false. Now you're going in circles, get more experince and these things will come to you. Also, try reading something...
Well, you just assigned tempObj to a completely different object which hasn't been checked to see if it's an element or an ending branch yet. It can't know to continue until this new tempObj is...
It just tries to return the right thing. If you notice, the code takes a step (does a tempObj=node.previousSibling before the while loop) to get it started but it doesn't check if it's an element so...
Usually (and officially?) no but browsers allow all sorts of strange things happen. What kind of programmer would put more than one HTML node in their page anyway?
NO! I don't think you understand the concept of null. null means that the variable has no value. If previousSibling has no value, then it means it has no siblings. If previousSibling is not null, it...
How do you try a command that the browser won't recognize? Isn't that like saying try{asldkfhnklasdf asdfawe}catch(er){alert("asdga")} or does it only semi-recognize it?
Anything can have a sibling. We're just checking that a) we have not already found our element b) we can't go any further because it's the end of the line (tip of the tree).
tempObj is always changing. We are looking for the closest sibling that is an element. Lets say we're going forward/up (direction=1). First, we look at the node and see that the node is not the top...
The closest element sibling. The "tempObj's previousSibling is not null" only applies if tempObj is not an element. If tempObj is an element, it would have exited already.
It says
while(there is an older/younger sibling)
{
go up/down the family tree;
}
If there aren't anymore sibling in the direction your traveling, the loop stops traveling (end of the road).