So I've got a script, when you mouseenter a div, it will load .html file into another div. What I want is to make this script work with many divs. I don't really want to write separate script for each image, instead use variable which base on div name. Let's say i got a div named p3 and when I hover my mouse over, I want the script to load p3.html. Here's the script to show you what I mean:
<script type="text/javascript">
$(document).ready(function () {
$('#p1').mouseenter(function () {
$('#description').load('descr/p1.htm');
});
$('#p1').mouseleave(function () {
$('#description').load('descr/portDefault.htm');
});
});
Any tip would be appreciated.