Jump to content

dynamic IDs Solved with thanks in the final post.


niche

Recommended Posts

What's the notation for the CSS for all the IDs the begin with: itemInfo? #itemInfo???? Can it work that way?

Link to comment
Share on other sites

That's how this page shows it. Technically, though, the ID selector is #. What CodeName is showing you is an attribute selector. The attribute in this case happens to be the ID.
In addition, An ID selector, targets just the ID attribute, while attributes selector, targets any specified attribute.
Link to comment
Share on other sites

I may not be following you. Are you saying is how to define the style for all IDs beginning with: itemInfo?

<style type="text/css">[id^=itemInfo] {   position:absolute;   background-color: yellow;    width: 300px;    height: 50px;    margin: 0px 0px 0px 105px;}</style>

Link to comment
Share on other sites

Yes. Thanks. How did you know where to use that ref that way?

Link to comment
Share on other sites

It worked. I forgot to change the id reference in the JS. Thanks to CodeName and ShadowMage for their help.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...