Link to home
Start Free TrialLog in
Avatar of lupire
lupire

asked on

html unique id attribute

Hi,

In order to create 2 different connections through 2 different links,
I have to add the following code in 2 parts of the html code:

<a id="enabled_element" href="#">

As the id attribute should be unique, only the first link is active.

How can I do to activated also the second link?

Thanks for pointing me in the right direction.
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

Can you use class="enabled_element" instead?

EDIT:  I just realized you are probably referring to Outlook Groupware connections of which I am not familiar.
Why does the element have to have the same id - which is obviously not allowed - what is the importance of the enabled_element id - with respect to your code?

Please post more information about your problem - the information you have given is not sufficient for us to be able to assist you.
I think it appear disabled/enabled with CSS so, locate the CSS file, look for :

#enabled_element

and replace: #enabled_element
by : #enabled_element, #enabled_element_second

<a id="enabled_element" href="#">
<a id="enabled_element_second" href="#">

Open in new window


or just use a class as suggested by tommyBoy, so replace : #enabled_element
by : .enabled_element

<a class="enabled_element" href="#">
<a class="enabled_element" href="#">

Open in new window

Avatar of lupire
lupire

ASKER

I have to use the id attribute.
When the application stars, it checks the site content for the specific ID (enabled_element). If these IDs are used on a element, then clicking this element will start an action.
It is because the enabled_element is unique.

But I would like to acivate the action on two different elements of the page.

I cannot use class.

Many thanks
>When the application stars, it checks the site content for the specific ID

Could you post(show us) this part?
Could you edit it?
Avatar of lupire

ASKER

>>When the application starts, it checks the site content for the specific ID

>Could you post(show us) this part?
>Could you edit it?

Unfortunately I can not edit the code application, I have only to configured the web site.
try this :
<a id="enabled_element1" href="#" onclick="this.id='enabled_element';">
<a id="enabled_element2" href="#" onclick="this.id='enabled_element';">

Open in new window


good luck...
Avatar of lupire

ASKER

<a id="enabled_element1" href="#" onclick="this.id='enabled_element';">
<a id="enabled_element2" href="#" onclick="this.id='enabled_element';">
                                           

I have to click twice on an element to start the action. But after I can not start the action on the other element.

I seems after having clicked on an element, the id remains setted on the clicked ID.

The only way to start the action on the other element is to reload the page.

Thanks for your help
ok, could you post the code setting the "action"?
Avatar of lupire

ASKER

I am not allowed to modify this code.
>I am not allowed to modify this code.

I don't want to see it to ask you to modify it...
Avatar of lupire

ASKER

here is the code:

function() {
      ka.c = [];
      ka.registerApiConsumer = function(callback, apiNames) {
            ka.c.push({a: apiNames, c: callback});
      }      
      ka.setLocale = function(locale) {
            ka.l = locale;
      }
      function h(a, b, c) {
            if (a.addEventListener) a.addEventListener(b, c, false);
            else if (a.attachEvent) a.attachEvent("on" + b, c, true);
      }
      h(window, "DOMContentLoaded", function() {window["x-ka-tmp-dom-ready"] = true;}, false);
      h(window, "load", function() {window["x-ka-tmp-window-alive"] = true;});
      if (!window["x-ka-tmp-window-name"]) window["x-ka-tmp-window-name"]=window.name;
      var q = document.getElementsByTagName("script")[0];
      if (q) {
            var g = document.createElement("script");
            g.setAttribute("src", "https://start.ka.biz/starter.js");
            g.setAttribute("type", "text/javascript");
            g.setAttribute("defer","defer");
            q.parentNode.appendChild(g);
            h(g, "load", function() {});
            h(g, "error", function() {});
      }
})();

many thanks
looking for : start.ka.biz/starter.js
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
could you post the code of : start.ka.biz/starter.js ?
Avatar of lupire

ASKER

I am not allowed to post it.
Thanks