Jump to content

nogray

Members
  • Posts

    930
  • Joined

  • Last visited

Posts posted by nogray

  1. If you use setAttribute, you would need to use getAttribute to see the value.

    e.g.

    var player = document.createElement( 'audio' );
    player.setAttribute('volume', 0.;
    alert(player.getAttribute('volume')); // alerts 0.8
    alert(player.volume); // alerts 1
    
    // setting the volume directly
    player.volume = 0.8;
    alert(player.volume); // alerts 0.8
    

     

     

  2. You are using getElementById but your select elements don't have an id attribute. Second, you can't add the time as the format you use in the select values. You'll get three strings put togather instead of the total time. You might want to change the value into the minutes (as numbers) so you can add them togather.

  3. Your code should work fine, but you might have a structure problem.

    If all the textareas are under the same parent, the parent innerHTML will be the first textarea (after that you'll get an error). So, you HTML should be something like this

    <div id="purchase-order-area">
        <div>
            <textarea id = "notes5" rows = "3" cols = "105" value = ""></textarea>
        </div>
        <div>
            <textarea id = "notes6" rows = "3" cols = "105" value = ""></textarea>
        </div>
    </div>

  4. If you want to use innerHTML for a select menu in IE, you would need to write the whole select tag and populate the div innerHTML

    e.g.

    var html = '<select><option>Hello in IE</option></select>';
    document.getElementById('my_div').innerHTML = html;
    

    Otherwise, you would need to create the options as elements (e.g. using document.createElement) and append them to the select menu.

  5. First, you would need to use a radio button since the user can only select one option and pass the object to the function because I assume you have more than on table row

    <input type="radio" value="#FF0000" onclick="changeColor(this);" name="Table_Row_1" />
    <input type="radio" value="#FF0000" onclick="changeColor(this);" name="Table_Row_1" />

     

    If your function, you can get the table row by looking up the parents node of the element

    function changeColor(obj){
        var td = obj.parentNode; // table cell
        var tr = td.parentNode; // table row
        tr.style.backgroundColor = obj.value; // change the tr background color
    }
    

    NOT TESTED

  6. First you are using getElementById('head1') and your input doesn't have an id property. If you have a div with the id "head1", it might cause a conflict because IE uses the names for input fields as variables. You might want to rename it to "head1_div" or something like that.

     

    You are trying to show, hide the input checkbox (head1) instead of the form and since it's undefined, you'll get an error.

  7. Yes, your onclick will work. If you want to make a function, you can do the following

    <input type="radio" onclick="my_name_change_func('english');" ....
    ... later in your script...
    function my_name_change_func(nm){
        document.getElementById('pfc_words').name = nm;
    }
    

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.