Link to home
Start Free TrialLog in
Avatar of NewWebDesigner
NewWebDesigner

asked on

How to access id property of a <div>

What is the correct syntax to access the id value of the div  in the getResults function?

<div id=<?php echo $_POST['ISBN1'] ?> onclick="getResults(this.id)"><img src=<?php echo $_POST['picUrl1'] ?> /></div>

Open in new window

Avatar of leakim971
leakim971
Flag of Guadeloupe image

function getResults(param) {
   alert( param ); alert the id !!

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial