Javascript-форум (https://javascript.ru/forum/)
-   Элементы интерфейса (https://javascript.ru/forum/dom-window/)
-   -   Проблема с изменением стиля (https://javascript.ru/forum/dom-window/35015-problema-s-izmeneniem-stilya.html)

Prophet_ 28.01.2013 11:14

Проблема с изменением стиля
 
Подскажите пожалуйста. Есть код:
var cell=document.getElementById('PTimesheetList3colWidthCache3');
cell.style.color="red";
alert(cell.innerHTML);


Объект найден, т.к. если убрать innerHTML выводится не null. Но перекрасить не удается, а сам innerHTML выводит пустое окно. В чем проблема?

animhotep 28.01.2013 11:26

видимо в вашем html, тк это работает
http://jsfiddle.net/kpQ6m/

Prophet_ 28.01.2013 11:35

</script>  
<div id='PEGA_GRID_CONTENT' ParitalRefresh='true' columnList='.ProjectName .RoleName .Hours(Mon) .Hours(Tue) .Hours(Wed) .Hours(Thu) .Hours(Fri) .Hours(Sat) .Hours(Sun) .HoursTotal .pyTemplateInputBox '
class='yui-skin-sam gPXFixed' 
style='width :;height:;display:inline;' 
gPropIndex='PTimesheetList3' 
editRowIndex='' sortProperty = '' sortType='' pyTargetSection="" threadProcessing="false" 
bFiltering="false"
bRODetails="false" 
showExpandedAll="false" 
focusibleGrid = "true"> 
<table id='gridLayoutTable' 
class='gridTable repeatReadWrite' 
cellspacing='0' 
cellpadding='0' 
id='repeatGrid' 
summary='TimesheetList' >
<tr><td valign='top' 
class='mainGridTableCell'>
<input type="hidden" 
name="PTimesheetList3colWidthGBL" 
id="PTimesheetList3colWidthGBL" 
value="" /> </td>
<td valign='top' 
class='mainGridTableCell' >
<input type="hidden" 
name="PTimesheetList3colWidthGBR" 
id="PTimesheetList3colWidthGBR" value="" /> 
<div id='gridBody_right' style='' ruleNav=""> 
<table class='gridTable ' 
frame='box'style='width:1250.0px;table-layout:fixed;'
cellspacing=0 cellpadding=0 id='bodyTbl_right'bRowResize="false"PL_PROP='.TimesheetList' PL_PROP_CLASS='Lanit-LanitBPM-General-Data-Timesheets-Timesheet' PRIM_PAGE='' GRID_REF_PAGE='pyWorkPage.TimesheetsLogWork'> 
<tr class='cellCont' >
<td class='cellCont rowHandleHead ' 
style='height:42;width:27px;'>&nbsp;</td> 
<th scope='col' 
class=' cellCont ' 
style='width:282px;'>
<div class='divCont'>
<span class='wspan'></span>
<div class='cellIn'><input type="hidden" name="PTimesheetList3colWidthCache1" id="PTimesheetList3colWidthCache1" value="" />
<nobr> <span class="iconRequiredLeft"></span>Проект<span class="iconRequiredRight"></span></nobr></div></div></th> 
<th scope='col' class=' cellCont ' 
style='width:218px;'>
<div class='divCont'>
<span class='wspan'></span>
<div class='cellIn'>
<input type="hidden" 
name="PTimesheetList3colWidthCache2" id="PTimesheetList3colWidthCache2" 
value="" /><nobr> 
<span class="iconRequiredLeft"></span>Тип Задачи<span class="iconRequiredRight"></span></nobr></div></div></th> 
<th scope='col' 
class='dataValueRead cellCont ' 
style='width:86px;'>
<div class='divCont'>
<span class='wspan'></span>
<div class='cellIn'>
<input type="hidden" 
name="PTimesheetList3colWidthCache3" id="PTimesheetList3colWidthCache3" 
value="" /><nobr>                   Пн 28.01.13          </nobr></div></div></th>


вот самый нижний элемент мне то и нужен.

danik.js 28.01.2013 13:44

Prophet_, ну опять двадцать пять :haha:
http://javascript.ru/forum/dom-windo...tml#post229345

Зачем перекрашивать невидимое? Оно же все равно н е в и д и м о е ))


Часовой пояс GMT +3, время: 22:44.