I'm trying to insert a white dot and some spaces when I press the keycode 9(TAB), but i can't get it to work. When I insert the dot it never appears in white, it's allways black.
Can someone help me?
The code that im using is this one:
function WebHtmlEditor1_KeyDown(oEditor, keyCode, oEvent) {
if (keyCode == 9) {
var point = document.createElement("SPAN");
var object = document.createElement("SPAN");
var style = point.style;
style.fontColor = "White";
console.log(style);
point.innerHTML = '<span style:"color="#ffffff"">TESTE</span>';
object.innerHTML = " ";
//console.log(object);
iged_insText(point.innerText, false);
iged_insText(object.innerText, false);
oEvent.cancel = true;
}
}
You have many typos.
point.innerHTML = '<span style:"color="#ffffff"">TESTE</span>';
:
) after the style
attribute when you should have an equals ( =
). =
) after the color
declaration when you should have a colon( :
). Replace that line with this one:
point.innerHTML = '<span style="color:#ffffff">TESTE</span>';
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.