Magic
Posting Freak
- Oct 11, 2012
- 1,026
- 196
So I am trying to make a simple reminder program in JavaScript and instead of writing the put in reminder it prints [object Object]
Thanks in advance <3x
HTML:
<HTML>
<HEAD>
<TITLE>
Reminder script
</TITLE>
<script language="Javascript">
var str;
function createReminder() {
var r1 = prompt("Add a reminder");
return r1;
}
function addReminder(){
str = new createReminder();
}
function showReminder() {
document.write(str+"<br>");
}
</script>
<input type="button" value="Add reminders" onclick="addReminder();">
<input type="button" value="Show reminders" onclick="showReminder();">
</HEAD>
<BODY>
</BODY>
</HTML>
Thanks in advance <3x