Jump to content

Chocolate570

Members
  • Posts

    1,550
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Chocolate570

  1. First of all, I'm not sure if this is a select box you're trying to find:var userselectedYearMonth=document.getElementById("selectYearMonth").value;and if it is, then the proper syntax is this:userselectedYearMonth=document.getElementById("selectYearMonth");userselectedYearMonth=userselectedYearMonth.options[userselectedYearMonth.selectedIndex].value;And that would return the value of your selected option.Also!The reason that error is popping up is that you're missing a parameter in your select.add(). FireFox will give an error if both parameters are not there. It doesn't matter whether one is null or not though.You have to give both of these parameters:select.add(element to add,element to put it before)If you put "null" in element to put it before it sticks it self at the end of the list. :)Hope that helps. It should clear up your error. :)Choco

  2. I don't know how anyone can make windows crash. I've tried everything. I've maxed out my ram and used both of my processors at 100% running around 20 DIFFERENT programs and loading a web page heavy on graphics. In the background, among the programs, was a direct x game and an open GL flight simulator. The moment I opened the two games everything froze for a second and then it started working again. Of course it was slow, but what else can you expect? :)Again, I don't see how you can make it crash. I'm running windows XP media center edition. I love watching TV :)I love the flashy XWD of Mac, but really, windows is what I'm used to. I use it on 3 out of my 4 primary machines (all at home) and never have trouble. I have MEPIS (a distro of linux) running on the other one. I'm not afraid to say I prefer windows. :) Why not? Most of the programs available run on it.

  3. innerText returns only the text inside a specific element.EXAMPLE:<p id="test"><b>zoop likes</b> monkeys with <u>butter</u></p>If you used this java script:<script type="text/javascript">x=document.getElementById("test");alert(x.innerText)</script>It would alert "zoop likes monkeys with butter". It basically strips out all formatting HTML from it and just returns the text.It can only be used in IE! For FireFox and Safari(not sure about Opera) use:alert(document.getElementById("test").textContent);Hope that helps.Choco

  4. Also, you might want to do it inline. It saves you space in your header section, and allows you to not have to make a new function :)<textarea id="txtContent" cols="80" name="txtContent" onfocus="if (this.innerHTML == 'Type the entry here...') this.value = ';'" rows="10">Type the entry here...</textarea>See if that works. :)

  5. Well, you might want to do this instead. :)

    <script type="text/javascript"><!--elements = document.getElementsByTagName("p");for(i=0;i<=elements.length;i++) {if (elements[i].className == 'test') {  elements[i].style.display = 'block';}}// --></script>

    Try that on for size. :) (I tested it on your page. It works perfectly. :)Choco

  6. It seems perfectly fine, except for the fact that it's returning a number 1 more than what you need...for example, the first option would be 0 in an array, and the second option would be 1, so you'd have to put this instead of what you have: for ( var r=0;r<obj.length-1;r++ )At least I think :)But the function itself seems fine...hmm...Where is the page that you're testing this on?

×
×
  • Create New...