The problem is that subject is not a valid attribute which fails validation.
Better yet, replace it with title instead:
Code:
<div class="gallerycontent" subject="What is JavaScript?">
.
.
.
<div class="gallerycontent" subject="Java & JavaScript Differences">
.
.
.
<div class="gallerycontent" subject="What is DHTML?">
...and change highlighted into title:
Code:
for (i=0;i<totalDivs;i++){
var thesubject=partscollect[i].getAttribute("subject")
...and if you're serving your page as XHTML, then you should surround your script into CDATA islands, or better call it externally.
Hope that makes sense.
Bookmarks