glz
04-06-2007, 04:45 AM
Hello everyone! my first post here at this site!
I am trying to accomplish this with javascript function:
1. change class of a <td> html
2. inside the td, there is html, i want to display a small pic to the right of it
--these to things are "onmouseover" or "onmouseout"
here is my function that I made:
<script type="text/javascript">
function showImg(id, class, imageurl){
document.getElementById('id').innerHTML = '<img src="imageurl" align="left">';
changeClass(id, class);
}
function changeClass(id,class) {
document.getElementById(id).className = class;
}
</script>
here is how I execute this function in my body html inside of a TD tag:
<td id="id1" class='tabla_novedades1' onclick="document.location='urlforalinkhere'" onmouseover="showImg(id1, tabla_novedades2);" onmouseout="showImg(id1, tabla_novedades1);">Name</td>
quite simply it doesn't do what my objectives i listed above
so what code do I need to fix this?
OR what new code do i need to accomplish my objectives above?
I KNOW I MESSED UP IN MY SYNTAX SOMWHERE COULD U POINT OUT WHERE?
-thanks
I am trying to accomplish this with javascript function:
1. change class of a <td> html
2. inside the td, there is html, i want to display a small pic to the right of it
--these to things are "onmouseover" or "onmouseout"
here is my function that I made:
<script type="text/javascript">
function showImg(id, class, imageurl){
document.getElementById('id').innerHTML = '<img src="imageurl" align="left">';
changeClass(id, class);
}
function changeClass(id,class) {
document.getElementById(id).className = class;
}
</script>
here is how I execute this function in my body html inside of a TD tag:
<td id="id1" class='tabla_novedades1' onclick="document.location='urlforalinkhere'" onmouseover="showImg(id1, tabla_novedades2);" onmouseout="showImg(id1, tabla_novedades1);">Name</td>
quite simply it doesn't do what my objectives i listed above
so what code do I need to fix this?
OR what new code do i need to accomplish my objectives above?
I KNOW I MESSED UP IN MY SYNTAX SOMWHERE COULD U POINT OUT WHERE?
-thanks