I have this little javascript code:
<script>
function editHouse()
{
if (edit == false) {
document.getElementById('edit').style.color='red';
edit = true;
}
else {
document.getElementById('edit').style.color='blue';
edit = false;
}
}
</script>
<button id="edit" onclick="editHouse()" type="button">@@@@</button>
Which changes the button text to red and blue everytime the button is pressed. However I need more than that, I need other content on the page to enable after the button has been pressed. An example could be enabling some javascript codes like this:
if (edit == false) {
<script language="javascript" type="text/javascript" src="js/jquery/jquery-1.5.2.min.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery/modalpopup.js"></script>
}
or even enabling whole chunk of codes, maybe including php database connections etc. Is there a way to do that? if I could just write something like:
<script>
if (edit == false) {
</script>
<script language="javascript" type="text/javascript" src="js/jquery/jquery-1.5.2.min.js"></script>
<script language="javascript" type="text/javascript" src="js/jquery/modalpopup.js"></script>
<script>
}
</script>
But that wasn't the correct way of doing it unfortunatly. Any ideas or suggestions? Thanks in advance.