Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/437.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用document.forms[0].elements[';someid';].style.backgroundColor_Javascript_Php_Html_Css - Fatal编程技术网

Javascript 使用document.forms[0].elements[';someid';].style.backgroundColor

Javascript 使用document.forms[0].elements[';someid';].style.backgroundColor,javascript,php,html,css,Javascript,Php,Html,Css,我在表单中设置了document.forms[0].elements['someid'].style.backgroundColor=“red”,并提交了它 如何获取“red”的值,以便在另一个页面中使用它来设置td行的背景色?当我提交表单时,我的目的是将$\u POST['someid'].style.backgroundColor发送到下一页的颜色值。我怎样才能做到这一点?echo'.$myobject.{background color:“.$\u POST['someid'].;}”;

我在表单中设置了
document.forms[0].elements['someid'].style.backgroundColor=“red”
,并提交了它

如何获取“red”的值,以便在另一个页面中使用它来设置td行的背景色?当我提交表单时,我的目的是将
$\u POST['someid'].style.backgroundColor
发送到下一页的颜色值。我怎样才能做到这一点?

echo'.$myobject.{background color:“.$\u POST['someid'].;}”;
 echo "<style> ".$myobject." { background-color:".$_POST['someid']."; } </style>";

我假设您有这样一个
td

<table>
    <tbody>
        <tr>
            <td></td>
        </tr>
    </tbody>
</table>

在这种情况下,您可能需要以下内容:

<table>
    <tbody>
        <tr>
            <td></td>
        </tr>
    </tbody>
</table>