console
(function() {
'use strict';
var dictionary= {
"you":"bbbbbb",
"store":"aaaaaa",
"about":"fast",
"Find":"on way",
"this":"gogogo"
};
$('#go').click(highlight);
function highlight(){
var NewWords = dictionary[1];
var FindWords = new RegExp(NewWords,'g');
$('span').each(function(){
var html = $(this).html();
var newHtml = html.replace(FindWords,NewWords);
$(this).html(newHtml);
});
};
})();
<h1>this is a demo</h1>
<p>oh, this man is so cool!</p>
<span>haa,it's sooo~ cooool~, <a id="go">I like this man</a></span>
body{
color: #fff;
}
p{
color: #a4a4a4;
}
a{
color: #bfb;
}
a:hover{
color: #ada;
cursor: pointer;
}
#wavy{
text-decoration-style: wavy;
}
#go{
width: 100px;
height: 30px;
}