突出显示在文本字段中输入的网页上的文本 [英] Highlight Text on the Web page entered in textfield

查看:59
本文介绍了突出显示在文本字段中输入的网页上的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含100条记录/行的网页,我想在网页中添加一个文本字段,我可以使用该字段按名称或任何其他唯一性搜索特定记录。

如果是输入文本出现在网页中然后它应该突出显示

解决方案

此操作实际上称为选择。



使用方法选择< input type =text> 元素:

http://www.w3schools.com/tags/tag_input.asp [ ^ ]。

 myTextBox = 文档 .getElementById(elementId);  //   elementId应该是根据ClientID值的字符串 
myTextBox.select(); // 此处选择所有文字





另请参阅: http:// msdn .microsoft.com / zh-cn / library / system.web.ui.control.clientid.aspx [ ^ ]。



-SA

I have a web page containing 100 records/rows , i want to add one text field in the webpage using which i can search a particular record by name or any other uniqueness..
If that input text is present in web page then it row should be highlighted

解决方案

This operation is actually called "selection".

Use the method select of <input type="text"> element:
http://www.w3schools.com/tags/tag_input.asp[^].

myTextBox = document.getElementById(elementId); // elementId should be a string according to the ClientID value
myTextBox.select(); // all text is selected here



See also: http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientid.aspx[^].

—SA


这篇关于突出显示在文本字段中输入的网页上的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆