我要说的是:
<div id="mainContent">some random text. bla bla bla.</div>
请允许我指出,这个例子中的序号是random
。 我怎么能把形象放在这个词上?
换言之,我将不得不发现,与 Java文的四处,然后使用定期表述来找到关键词,然后可以总结一下,在一带内,关键词将一成不变。
我猜想,这方面最难部分的是,用一刀阔 the的词句??
edit
此外,我怎么能把形象放在这个词的中心? do 我不得不在一张桌子上总结?
我要说的是:
<div id="mainContent">some random text. bla bla bla.</div>
请允许我指出,这个例子中的序号是random
。 我怎么能把形象放在这个词上?
换言之,我将不得不发现,与 Java文的四处,然后使用定期表述来找到关键词,然后可以总结一下,在一带内,关键词将一成不变。
我猜想,这方面最难部分的是,用一刀阔 the的词句??
此外,我怎么能把形象放在这个词的中心? do 我不得不在一张桌子上总结?
第一,将四卷的内容储存在:
var x = document.getElementById( abc ).innerHTML;
然后,用包装版取代关键词。
var keyword = "test";
x.replace(keyword, "<span>"+keyword+"</span>");
之后又回去;
document.getElementById( abc ).innerHTML = x;
我认为,最好利用这一点:
x.replace( + keyword + , "<span>"+keyword+"</span>");
符合字边界。
For the answer you accepted, you have to know the id of the div that has the keyword. This solution is a bit more dynamic and uses jquery to find all divs with your keyword so you could place images on all of them.
var keyword = "random";
var found = $( div:contains(" + keyword + ") );
$.each(found, function(){
var wrapper = <span class="whatever"> + keyword + </span> ;
var oldHtml = $(this).html();
$(this).html(oldHtml.replace(keyword, wrapper));
});
How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.
I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...
Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...
Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...
I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...
Is it possible for someone to give me a few pointers on how to display a multidimensional array in the form of a bar graph? The array is multidimensional, with three elements in each part - and the ...
Is it possible to reload a form after file-input change? I have a form where the user can chose an image for upload. I also have a php script which displays that image resized. I only wonder if it ...
I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.