• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dynamically Change html name Attribute with delegate function

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have the js and the html at the location: http://jsfiddle.net/T9e9Z/2/

It's working fine but i would like to add an additional feature where i need different name attribute for select and input tag eg. like key1, key2 and so on when i click on +?
How i can accomplish that?

I have tried to use something like below but not sure how that works:

var nam = "key"+ counter;
..
counter++
document.getElementsByTagName('select').setAttribute('name', nam);


Complete HTML and JS code below as well:

HTML:



JS:

 
Ramneek Singal
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A colleague helped with the answer and it is:



Note: For select.key to work you have to add the attribute class in the select tag.

Thanks!

 
reply
    Bookmark Topic Watch Topic
  • New Topic