script type text javascript src js jquery js script script type text j

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
document.write('<div class="foreach" id="'+i+'" style="display: none;">{short-story}</div>')
document.write('<a href="">{title}</a>')
if (typeof i == 'undefined') {
i = 1
}
something = document.getElementById(i)
myvar = $(something).attr("id")
alert(myvar)
i += 1
</script>