<!DOCTYPE html>
<html>
<body>
<div id="AFG">HELLO</div>
<script type='text/javascript'>
function getquerystring(what) {
var qstr = document.getElementById(what).innerHTML;
return qstr;
}
console.log(getquerystring('AFG'));
</script>
</body>
</html>