正则表达式选择textarea的内容 [英] Regular expression to select the contents of textarea

查看:288
本文介绍了正则表达式选择textarea的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿如何编写正则表达式来选择textarea的内容(我需要一键选择所有内容)



document.getElementById('text' ).focus();

document.getElementById('text')。select();



试过这个...但是想用正则表达式写相同的东西

Hey how to write regular expression to select the contents of textarea(i need to select all the contents in one click)

document.getElementById('text').focus();
document.getElementById('text').select();

Have tried this...but want to write the same thing using regular expression

推荐答案

你好,



普通快递可以让你去根据表达式验证一些文本/值。但你要做的事情就像你已经做过的那样或使用jquery。
Hi,

A regular express lets you to validate some text/value as per expression. But the thing you wants to do can be done as you already did or use jquery.


这篇关于正则表达式选择textarea的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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