There's a piece of html code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Code</title>
<body>
<div id="suggestions">
content
<p><a href="/pd?email=1@email.com&pd=187&name=kljljl">link</a></p>
<p><a href="/pd?email=6@email.com&pd=187&name=afdsfsa">link</a></p>
</div>
<div id="list">
kklj
<p><a href="/pd?email=10@email.com&pd=187&name=4fdaf">link1</a></p>
dll
<p><a href="/pd?email=2@email.com&pd=187&name=afdsf">link2</a></p>
fdf
<p><a href="/pd?email=1@email.com&pd=187&name=hgfhd">link3</a></p>
fdsaf
<p><a href="/pd?email=4@email.com&pd=187&name=ertewt">link4</a></p>
fdsaf
<p><a href="/pd?email=5@email.com&pd=187&name=gfdsg">link7</a></p>
fdasf
<p><a href="/pd?email=8@email.com&pd=187&name=fdsgfgsg">link3</a></p>
fdsaf
<p><a href="/pd?email=dd@email.com&pd=187&name=cxvbvcb">link8</a></p>
fdsafd
<p><a href="/pd?email=jh@email.com&pd=187&name=ujjhgh">link3</a></p>
</div>
<script>
document.addEventListener('click', function(e){
})
</script>
</html>
I want to be able to get the email
value and pd
value of the current href
when I click on a href
under list
. I can get it easily with JQuery, but I don't know how to do without it. Any ideas? Thank you.