html内联样式和外联,外部CSS与内联样式的性能差异?

function handleSelect(xId){

//

// TESTPOINT

alert("TESTPOINT\r>Grid: " + xId);

//

// GET BORDER COLOR

// NOTE: An empty or blank value when you can see a border means the tag itself does not

// have 'border properties' (style="border: 2px{width} solid{style} green{color}").

// although there can be a border detailed via css local or external or via code (script).

// If the 'border properties' are returned then they were setup at the tag as

// above or the 'border properties' were updated by script code not css code.

// If the 'border properties' are NOT returned then they were setup via css.

// Thus, since everything seems to be heading toward edit on the fly (live) then css is NOT the way to go (learning).

// HINT: Margin property is also not readable if set via css. Most likely all the properties values are the same way.

// Thus, setting the property values of a tag should be set at the tag control.

// (works) cBorder=document.getElementById(xId).style.borderWidth;

// (works) cBorder=document.getElementById(xId).style.borderStyle;

// (works) cBorder=document.getElementById(xId).style.borderColor;

// (works) cBorder=document.getElementById(xId).style.border;

//cBorder=document.getElementById(xId).style.border;

cBorder=document.getElementById(xId).style.margin;

alert("TESTPOINT\r>Grid: " + xId + "\r>Border: " + cBorder);

//

// SELECT IMAGE

document.getElementById(xId).style.margin="1px";

document.getElementById(xId).style.border="2px solid gold";

document.getElementById(xId).innerHTML=xId;

alert("TESTPOINT\r>Grid: " + xId + "\r>Border: " + cBorder + "\r>[set border color gold]");

//

// GET BORDER COLOR

//var cBorder=document.getElementById(xId).style.border-Color; //Error

//var cBorder=document.getElementById(xId).style.border-color; //Error

//var cBorder=document.getElementById(xId).style.borderColor; //Error

//var cBorder=document.getElementById(xId).style.bordercolor; //Undefined

cBorder=document.getElementById(xId).style.border; //Empty

alert("TESTPOINT\r>Grid: " + xId + "\r>Border: " + cBorder + "\r>[set border color gold]" + "\r>Border: " + cBorder);

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值