Created
February 21, 2017 16:33
-
-
Save saintthor/47ba7c84271713bb630f1405718bf723 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/bacudi
This file contains 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> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<script src="https://code.jquery.com/jquery-2.2.4.js"></script> | |
<style id="jsbin-css"> | |
span { color: red } | |
</style> | |
</head> | |
<body> | |
<div contenteditable=true>wwww[A]oooo</div> | |
<button>color</button> | |
<script id="jsbin-javascript"> | |
$( 'button' ).click( function() | |
{ | |
var html = $( 'div' ).text(); | |
$( 'div' ).html( html.replace( /\[A\]/g, '<span>[A]</span>')); | |
}); | |
</script> | |
<script id="jsbin-source-css" type="text/css">span { color: red }</script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
$( 'button' ).click( function() | |
{ | |
var html = $( 'div' ).text(); | |
$( 'div' ).html( html.replace( /\[A\]/g, '<span>[A]</span>')); | |
});</script></body> | |
</html> |
This file contains 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
span { color: red } |
This file contains 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
$( 'button' ).click( function() | |
{ | |
var html = $( 'div' ).text(); | |
$( 'div' ).html( html.replace( /\[A\]/g, '<span>[A]</span>')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment