I want to use the same class for div's as they serve the same purpose, although I cannot find a way to get it to work without outputing the same result to both of the div's.
JavaScript
<script src="jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function divide(a, b) {
$(this).text(a + " / " + b);
}
</script>
HTML
<body>
<div class="division" ><script type="text/javascript">divide(3,7)</script>
</div>
<div class="division" ><script type="text/javascript">divide(12,75)</script>
</div>
</body>
div?thiswill refer to the global object, which iswindow, it does not refer to any DOM element. Maybe you have to provide a better example, I don't see why you just don't write3/7and12/75in eachdiv.