Dynamic image changing and JavaScript debugging

I and my  colleague are creating a software to track the students plan regarding their progress in their academic . In that we wanted to upload the students pictures when they select their name. I learnt to deal with dynamic images and to debug the code in JavaScript using

<div class=”animptext” id=”animptext”>This is just a text I want to change </div>

document.getElementById(“animptext”).innerHTML = standard;