So, I have this select object:
<select id="alunos" onchange="arteAluno(this);">
<option selected="selected"></option>
<option value="loadImage();">Aluno 1</option>
<option value="../Index.html">Aluno 2</option>
<option value="../Index.html">Aluno 3</option>
</select>
and this function
function arteAluno (sel) {
var url = sel[sel.selectedIndex].value;
window.location = url;
}
and I was making the page change with this. But now I want to get this code:
$(document).ready(function() {
function O(obj){
return document.getElementById(obj);
}
function loadImage(){
O('arte').style.backgroundImage="url(aikido.jpg)";
O('arte').style.width = '200px';
O('arte').style.height = '160px';
}
})
and make this function loadImage only be triggered when I select one of the options of the tag. There may be like 2 hours I'm stuck. Thanks everyone!!