I am having a problem with something I really don't seem to understand to well, DOM!
I am trying to modify some code I have on our company intranet. Right now the code retrieves a list of employees for a store thru sql and displays each employee in a div. I am trying to assign one of the fields (the employee id) as the id for each div I populate with the other field from the recordset which is the employee name.
This seems to work as there is no error being thrown on the page and it displays just as I expect it to. The thing is, I cannot verify this as the div id's value is not displayed anywhere.
To test this out I added a small popup alert on the mouseover that I thought would display the value of the div's id. All I get displayed on the popup though is '[object]'.
Is it just bad code or is this not possible? I eventually hope to get a real popup window that will display the employee's picture based on the div id's value, but need to make sure it is there now before I proceed.
Below is the code as it is now. Any suggestions will be greatly appreciated...
I am trying to modify some code I have on our company intranet. Right now the code retrieves a list of employees for a store thru sql and displays each employee in a div. I am trying to assign one of the fields (the employee id) as the id for each div I populate with the other field from the recordset which is the employee name.
This seems to work as there is no error being thrown on the page and it displays just as I expect it to. The thing is, I cannot verify this as the div id's value is not displayed anywhere.
To test this out I added a small popup alert on the mouseover that I thought would display the value of the div's id. All I get displayed on the popup though is '[object]'.
Is it just bad code or is this not possible? I eventually hope to get a real popup window that will display the employee's picture based on the div id's value, but need to make sure it is there now before I proceed.
Below is the code as it is now. Any suggestions will be greatly appreciated...
Code:
cellString = "<div id=" & objRS("employid") & " style=width:auto;padding-left:5px onmouseover=""style.backgroundColor='#264B88';style.color='#ffffff';alert(document.getElementsByTagName('id').item)"" onmouseout=""style.backgroundColor='#FFFFFF';style.color='#6699FF'"">" & objRS("Extension_List") & "</div>"