Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6547921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:53:20+00:00 2026-05-25T11:53:20+00:00

I am attempting to derive some identifying property from this element: <div class=rtsLevel rtsLevel1>

  • 0

I am attempting to derive some identifying property from this element:

<div class="rtsLevel rtsLevel1">
  <ul class="rtsUL">
    <li class="rtsLI rtsFirst rtsLast">
      <a class="rtsLink rtsSelected" href="#">
        <span class="rtsOut">
          <span class="rtsIn">
            <span class="rtsTxt">Dashboard</span>
          </span>
        </span>
      </a>
    </li>
  </ul>
</div>

using this javascript:

function OnClientDragging(sender, eventArgs) {
    var target = eventArgs.get_htmlElement();
    console.log(target);
    var currentZone = TryGetZoneFromTarget(target);
}

function TryGetZoneFromTarget(target) {
//If the mouse moves too quickly target.id returns a red herring.
if (/\S/.test(target.id) == false) {
    if (target.indexOf("rtsLevel") != -1) {
        return null; //The tabstrip has an invisible div which doesn't have an ID, but isn't a redherring.
    }

    return undefined;
}

The div doesn’t have an id specified, but I don’t seem to be able to ‘talk’ to it at all, either. I’ve tried ‘.hasClass(“rtsLevel”)’ and was being told hasClass not defined, so I tried to do a string comparison, but hit the same wall.

What am I doing incorrectly?

EDIT: Solution was if ( $(target).hasClass('rtsLevel') ) {

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:53:21+00:00Added an answer on May 25, 2026 at 11:53 am

    If target is a valid DOM element, then you should be able to do:

    target.className.indexOf("rtsLevel") != -1
    

    or if you’re using jQuery and target is a DOM element, you can do:

    $(target).hasClass("rtsLevel")
    

    if target.className is undefined, then target is not a DOM element and that would be your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Attempting to use the data series from this example no longer passes the JSONLint
I'm attempting to make a messaging system in which any class derived from Messageable
So, I'm attempting to offset this html by 300 pixels, from the top and
I am attempting to store objects derived from a templated base class in an
Attempting to print out a list of values from 2 different variables that are
Attempting to deploy a MOSS solution to a UAT server from dev server for
I have a constructor attempting to initialize a field in a base class. The
I'm attempting to add a method to a grails domain class, e.g. class Item
I'm attempting to have a derived class (normal template) that has a variable of
I am attempting to do something like: class Base { public: Base() { cout

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.