更改文本框中文本的颜色 [英] Change color of text in textbox

查看:123
本文介绍了更改文本框中文本的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 $( #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屋!

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