Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>JS Bin</title>
    <!-- Store.js v1.3.7 -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/store.js/1.3.7/store.min.js"></script>
</head>
<body>
        <div id="view"></div>
        <form>
            <hr />
            <label>Key</label><input type="text" id="key" value="user" >
            <label>Value</label><input type="text" id="value" value="Tom" >
            <hr />
            <input type="submit" value="Update" onclick="javascript:update()">
            <input type="button" value="Remove" onclick="javascript:remove()">
        </form>
        <script>
            read();
            function update()
            {
                // 寫入資料
                store.set( document.getElementById( "key" ).value, document.getElementById( "value" ).value );
                read();
            }
            function remove()
            {
                // 移除資料
                store.remove( document.getElementById( "key" ).value );
                read();
            }
            function read()
            {
                // 讀取資料
                var data = store.getAll();
                document.getElementById( "view" ).innerHTML = JSON.stringify( data );
            }
        </script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
hsuehmingfangpro
0viewers