Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Feb 2011

    Add Class To All Element

    Hi guys,

    Let's say, I have the following HTML:

    [code lang="html"]
    <div id="detail_1"></div>
    <div id="detail_2"></div>
    <div id="detail_3"></div>
    <div id="detail_4"></div>
    <div id="detail_5"></div>
    <div id="detail_6"></div>
    <div id="detail_7"></div>

    Because, that detail is automatically generated and came between 0 to 10 (depending on what category I choose). How do I add add class to all of this in a simpler way? Is there mwl function I can use?

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003

    Re: Add Class To All Element


    I didnt yet find an elegant way to add a class to multiple elements, with only client side operations.

    One way you can do it, is by generating mwl.addClass('detail_'+i) calls for every element, but that's not a super nice solution and still needs a trigger to activate it.

    If you can live with server side execution, you can easily do this with CSS selectors.


Similar Threads

  1. i wanna get all images in my phone to add selected to image[ ]
    By buffon2009 in forum Mobile Java General
    Replies: 4
    Last Post: 2010-12-07, 18:16
  2. How to add my own icon to List Box element??
    By rohanwaugh in forum Symbian User Interface
    Replies: 10
    Last Post: 2008-11-29, 18:38
  3. How to add a class derived from CAkndialog?
    By swinglinewind in forum Mobile Java General
    Replies: 1
    Last Post: 2006-03-12, 17:25
  4. add new class to the project
    By smallfish_ntu in forum Symbian
    Replies: 1
    Last Post: 2003-02-10, 02:30
  5. How to add a new class
    By t_sridevi in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2002-11-27, 13:49

Posting Permissions

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