Pages

Saturday, December 18, 2010

Web - Save To Remember

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
  <title>Save To Remember</title>
</head>

<body>
<div id="body">
    <div id="editor">
        <div id="ed-title">Title
            <input type="text" size="50px" id="ed-titles"/>
        </div>
        <div id="ed-message">
            <textarea id="ed-textarea" cols="60" rows="5" align="bottom"></textarea>
        </div>
        <div id="ed-send">
            <input type="submit" id="ed-send" value="Save" onclick="save()"/>
        </div>
    </div>
    <div id="post">
        <div class="post-msg">
            <div id="post-title">Title</div>
            <div id="post-body">Body</div>
        </div>


    </div>
</div>

<style>
body, div, h1 { margin: 0px; }
#body { border: 1px solid #aaa; padding: 10px; margin:10px auto; width: 60%; }
#editor { border: 1px solid #ccc; padding: 10px; margin-bottom: 10px; }
#post { border: 1px solid #ccc; overflow: auto; padding: 10px; }

</style>

<script>
var edTitle = document.getElementById('ed-titles');
var edTextarea = document.getElementById('ed-textarea');

function save(){
    var title = edTitle.value;
    var text = edTextarea.value;
    alert(title+': '+text);

}

</script>

</body>

</html>

No comments:

Post a Comment