this is code 

```
 <c:forEach items="${names}" var="jk">
        <a href="openmessage" onclick="sendtoanother();" >
                <a1>${jk.read}</a1>
                <az3>${jk.idnum}</az3>
        </a>
     </c:forEach>

```

---

javascript for selecting the value and showing in alert box

```
   var df = document.getElementsByTagName('az3');
   var de = document.getElementsByTagName('a1');
                function sendtoanother() {
                    alert(df+" "+de); }

```