td{background-color:#996633;color: #345456}

解决方案 »

  1.   

    try highlight or highlighttext
      

  2.   

    <script>
    function setcolor()
    {
    bgcolor=document.all.mytext.style.background.substr(1);
    document.all.mytext.style.color=0xffffff-bgcolor;
    }
    </script>
    <input type=text id=mytext onPropertyChange="setcolor(this)">
    <input type=button value=red onclick="document.all.mytext.style.background='#FF6142';setcolor()">
    <input type=button value=green onclick="document.all.mytext.style.background='#42E3D6';setcolor()">
    <input type=button value=lilac onclick="document.all.mytext.style.background='#E7E7FF';setcolor()">
    <input type=button value=black onclick="document.all.mytext.style.background='#000000';setcolor()">
      

  3.   

    sorry
    <script>
    function setcolor()
    {
    bgcolor=document.all.mytext.style.background.substr(1);
    document.all.mytext.style.color=0xffffff-bgcolor;
    }
    </script>
    <input type=text id=mytext>
    <input type=button value=red onclick="document.all.mytext.style.background='#FF6142';setcolor()">
    <input type=button value=green onclick="document.all.mytext.style.background='#42E3D6';setcolor()">
    <input type=button value=lilac onclick="document.all.mytext.style.background='#E7E7FF';setcolor()">
    <input type=button value=black onclick="document.all.mytext.style.background='#000000';setcolor()">