Created
November 28, 2015 18:12
-
-
Save kakari2/dee50e74587589adf298 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!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="ja" lang="ja" dir="ltr" xmlns:og="http://ogp.me/ns#" xmlns:mixi="http://mixi-platform.com/ns#"> | |
| <head> | |
| <meta http-equiv="Content-Language" content="ja" /> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
| <script type="text/javascript" src="jquery-1.11.3.min.js"></script> | |
| <script type="text/javascript" src="jquery.highlight-5.js"></script> | |
| <style type="text/css"> | |
| .highlight { | |
| background-color:yellow; | |
| } | |
| </style> | |
| <script type="text/javascript"> | |
| function doHighlight() { | |
| var word = $("#word").val(); | |
| $("#target").highlight(word); | |
| } | |
| $(window).load(function () { | |
| doHighlight(); | |
| }); | |
| //window.onload = doHighlight(); | |
| </script> | |
| </head> | |
| <body> | |
| <input type="text" id="word" value="goo" /> | |
| <!--<input type="button" onclick="doHighlight()" value="入力された文字をハイライト" /><br /> | |
| --> | |
| <br /> | |
| <br /> | |
| <div id="target"> | |
| テスト<br /> | |
| あいうえおかきくけこ<br /> | |
| 漢字漢字漢字漢字漢字漢字<br /> | |
| abcdefg | |
| <div id="a"> | |
| <span>test test1 test2</span> | |
| <a href="http://google.com/">google</a> | |
| </div> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment