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>
    <!-- Ace v1.2.9 -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js"></script>
</head>
<body>
    <div id="example">
        var a = 1;
        function example () {
            console.log( "Hello World" );
        }
    </div>
    Search: <input type="text" id="keyword" /><input type="button" onclick="search()" value="Next" />
    <style>
        #example {
            width: 100%;
            height: 240px;
        }
    </style>
    <script>
        var editor = ace.edit( "example" ); 
        editor.setReadOnly(true); // 不允許寫入
        editor.session.setMode( "ace/mode/javascript" ); // 模式
        function search ()
        {
            editor.find( document.getElementById( "keyword" ).value, {
                // 搜尋參數設定[註1]
                backwards: false, // 從底部往上搜尋
                wrap: true, // 當搜尋至底部時,則返回頂端
                caseSensitive: false, // 大小寫
                wholeWord: false, // 單字完全符合
                regExp: false // 正規表達式
            });
            editor.findNext();
            editor.findPrevious();
        }
    </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
hsuehmingfangpro
0viewers