Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    ott
    ott is offline
    New Coder
    Join Date
    Apr 2006
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need code to check if exists in an elements attribute pls

    Anybody please come up with something faster and better than this:
    Code:
    if ((" " +e.getAttribute("className").indexOf("make_sortable") != -1)) { //then do something }
    see i want it to check if an attributes classname has make_sortable in it. Thats for potential use of multiple classnames like class="redbox boldLetters".
    I want to find a once and for all solution...thanks
    Last edited by ott; 05-03-2006 at 12:00 AM.

  • #2
    ott
    ott is offline
    New Coder
    Join Date
    Apr 2006
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that throws an arror if attribute doesn't exist in mozilla
    Last edited by ott; 05-03-2006 at 12:44 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •