Javascript written in Dreamweaver behaves different when inserted in Muse
Wickedhand Nov 2, 2014 5:33 AMI have a simple javascript list that is written in Dreamweaver and works as expected but when I copy & paste that exact javascript into the -Object-insert html section in Muse the outcome is different.
Is there a place I can go to research on what I need to do different for that code to behave properly in Muse? I am not understanding what I need to change or do different.
Below is the code I got to work in Dreamweaver:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>list</title>
<script type="text/javascript">
function fixTheList(){
var msg = "";
var msg = "";
if (document.getElementById("appleQty").value > 0) {
msg += "Apples ";
msg +=document.getElementById("appleQty").value;
msg += "<br>";
}
if (document.getElementById("orangesQty").value > 0) {
msg += "Oranges ";
msg +=document.getElementById("orangesQty").value;
msg += "<br>";
}
if (document.getElementById("tangerineQty").value > 0) {
msg += "Tangerines ";
msg +=document.getElementById("tangerineQty").value;
msg += "<br>";
}
if (document.getElementById("kiwiQty").value > 0) {
msg += "Kiwis ";
msg +=document.getElementById("kiwiQty").value;
msg += "<br>";
}
if (document.getElementById("pearsQty").value > 0) {
msg += "Pears ";
msg +=document.getElementById("pearsQty").value;
msg += "<br>";
}
if (document.getElementById("grapesQty").value > 0) {
msg += "Grapes ";
msg +=document.getElementById("grapesQty").value;
msg += "<br>";
}
if (document.getElementById("canteloupeQty").value>0) {
msg += "Canteloupes ";
msg+=document.getElementById("canteloupeQty").value;
msg += "<br>";
}
if (document.getElementById("strawberryQty").value>0) {
msg += "Strawberry ";
msg+=document.getElementById("strawberryQty").value;
msg += "<br>";
}
document.getElementById("outputDiv").innerHTML = msg;
}
</script>
</head>
<body>
<div id="outputDiv">
<table>
<tr>
<td>Item</td>
<td>Quantity</td>
</tr>
<tr>
<td>Apples</td>
<td><input type="text" size="3" id="appleQty"></td>
</tr>
<tr>
<td>Oranges</td>
<td><input type="text" size="3" id="orangesQty"></td>
</tr>
<tr>
<td>Tangerines</td>
<td><input type="text" size="3" id="tangerineQty"></td>
</tr>
<tr>
<td>Kiwi</td>
<td><input type="text" size="3" id="kiwiQty"></td>
</tr>
<tr>
<td>Pears</td>
<td><input type="text" size="3" id="pearsQty"></td>
</tr>
<tr>
<td>Grapes</td>
<td><input type="text" size="3" id="grapesQty"></td>
</tr>
<tr>
<td>Cantaloupe</td>
<td>
<input type="text" size="3" id="canteloupeQty">
</td>
</tr>
<tr>
<td>Strawberry</td>
<td><input type="text" size="3" id="strawberryQty">
</td>
</tr>
</table>
<input type="button" value="Stack" onclick="fixTheList();">
</div>
</body>
</html>


