Alright,
so I have the prompt box working almost exacly the way I want. There is one more thing I would like to accomplish.
Currently I have somthing like this:
I would like; var textBox = <to whatever is inside the destination div>
so in the above example when the user first opens the prompt box, the value in the text area is "THIS IS THE DESTINATION DIV".
I'm assuming this will have to first get the element by Id and then read the innerHTML...not sure how to o about this. Any suggestions?
Thanks
atSea
so I have the prompt box working almost exacly the way I want. There is one more thing I would like to accomplish.
Currently I have somthing like this:
Code:
<script>
function javascript_prompt() {
//two arguments are required for "prompt" boxes
var message = "Please enter you Name";
//the default value for the text
var textBox = "";
var user_value = prompt(message,textBox);
// check if there is a value to return
if (user_value != null) {
//if ok do this
attention = document.getElementById('attn');
attention.innerHTML = user_value;
} else {
//if "cancel" do this
return null;
}
}
</script>
<div onClick="javascript_prompt()">JavaScript Popup</div>
<div id="attn">THIS IS THE DESTINATION DIV</div>
I would like; var textBox = <to whatever is inside the destination div>
so in the above example when the user first opens the prompt box, the value in the text area is "THIS IS THE DESTINATION DIV".
I'm assuming this will have to first get the element by Id and then read the innerHTML...not sure how to o about this. Any suggestions?
Thanks
atSea