更改文本框中文本的颜色 [英] Change color of text in textbox
本文介绍了更改文本框中文本的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$( #subttraction)。dblclick(function (){
str = str + + - ;
$( #ctl00_ContentPlaceHolder1_txtCreateColumn)。val(str);
});
I想要在txtCreateColumn文本框中更改 - (减法标志)的颜色。
我该怎么办?
解决方案
(< span class =code-string> #subttraction)。dblclick(function(){
str = str + + - ;
( #ctl00_ContentPlaceHolder1_txtCreateColumn跨度>)VAL(STR)。
});
我想在txtCreateColumn文本框中更改 - (减法标志)的颜色。 />
我该怎么办?
你不能给html INPUT元素里面的部分文本格式化,你只能格式化整个文本。
$("#subtraction").dblclick(function () {
str = str + " " + "-";
$("#ctl00_ContentPlaceHolder1_txtCreateColumn").val(str);
});
I want to change the color of "-" (subtraction sign) in txtCreateColumn textbox.
how can I do it?
解决方案
("#subtraction").dblclick(function () { str = str + " " + "-";
("#ctl00_ContentPlaceHolder1_txtCreateColumn").val(str); });
I want to change the color of "-" (subtraction sign) in txtCreateColumn textbox.
how can I do it?
You can not give format to part of the text inside a html INPUT element, you can only format the whole text.
这篇关于更改文本框中文本的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文