尊敬的会员,
我在一个模板的帮助下设计纯HTML网站。
在这我有一个文本框[搜索]和开始按钮。
我想进行操作,以便当任何一个键入某些文本并按下Go按钮时,它应该突出显示该网站中与该文本匹配的文本。
我该怎么做?
解决方案搜索网站意味着您需要从html代码中找到一个字符串。您可以在这种情况下使用JavaScript。
var position = document.documentElement.innerHTML.indexOf('text to search');这会返回您的位置,您可以修改帽子字符串的css焦点。
Respected Members,
I am designing the website in pure HTML with the help of one Template.
In that i have one textbox[search] and Go button.
I want to make operation such that when any one types certain text and presses Go button, It should highlight the text in that website which is matching to that text.
How can i do that?
Than You.
解决方案searching website means you need to find a string from html code. You can use javascript in this case.
var position = document.documentElement.innerHTML.indexOf('text to search');This will return you the position, the you can modify the css for hat string to focus.
更多推荐
搜索网站上的文字
发布评论