Loading ...
Sorry, an error occurred while loading the content.

Re: tabs with close icon - how to setLabel without removing the icon?

Expand Messages
  • rolfsf
    Thanks - yes - I knew I could do that, but I was hoping there was something a little cleaner
    Message 1 of 4 , May 5, 2009
    • 0 Attachment
      Thanks - yes - I knew I could do that, but I was hoping there was something a little cleaner


      --- In ydn-javascript@yahoogroups.com, "D. Wayne Fincher" <slowlychillin@...> wrote:
      >
      > Hello, perhaps you could set the label and add in " <span class="icon tab-close"></span>" as well.
      >
      > The label would change and the close icon would be replaced, but the user wouldn't know that.
      >
      > Hope that helps...
      >
      >
      >
      > --- In ydn-javascript@yahoogroups.com, "rolfsf" <rolfsf@> wrote:
      > >
      > > I've got some tabs with the following basic markup
      > >
      > > <li>
      > > <a href="#one">
      > > <em>One <span class="icon tab-close"></span></em>
      > > </a>
      > > </li>
      > >
      > > If I try to change the label of the tab using the tab.setLabel(); method, it replaces everything inside the <em>. Is there a simple method to just change the text?
      > >
      > > thanks
      > >
      >
    • D. Wayne Fincher
      You re welcome. Well, if you wrap your text in an element, perhaps a span, and add an id to it, you could access the innerHTML of that span. I m not sure if
      Message 2 of 4 , May 5, 2009
      • 0 Attachment
        You're welcome. Well, if you wrap your text in an element, perhaps a span, and add an id to it, you could access the innerHTML of that span. I'm not sure if you would consider that cleaner/less clean (my opinion is it's less, but it's just an opinion :P )

        But that'd be another way. I do not think there is a built in method to change just the text in an <em> and not child elements inside that em.

        Cheers


        --- In ydn-javascript@yahoogroups.com, "rolfsf" <rolfsf@...> wrote:
        >
        > Thanks - yes - I knew I could do that, but I was hoping there was something a little cleaner
        >
        >
        > --- In ydn-javascript@yahoogroups.com, "D. Wayne Fincher" <slowlychillin@> wrote:
        > >
        > > Hello, perhaps you could set the label and add in " <span class="icon tab-close"></span>" as well.
        > >
        > > The label would change and the close icon would be replaced, but the user wouldn't know that.
        > >
        > > Hope that helps...
        > >
        > >
        > >
        > > --- In ydn-javascript@yahoogroups.com, "rolfsf" <rolfsf@> wrote:
        > > >
        > > > I've got some tabs with the following basic markup
        > > >
        > > > <li>
        > > > <a href="#one">
        > > > <em>One <span class="icon tab-close"></span></em>
        > > > </a>
        > > > </li>
        > > >
        > > > If I try to change the label of the tab using the tab.setLabel(); method, it replaces everything inside the <em>. Is there a simple method to just change the text?
        > > >
        > > > thanks
        > > >
        > >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.