There is no attribute "id" in any tag definition
See original GitHub issueActual workaround :
div(.....) {
attributes["id"] = "special-div"
}
Expected api :
div(id = "special-div".....) {}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:7 (2 by maintainers)
Top Results From Across the Web
flask-login using UserMixin - no 'id' attribute error despite ...
The reason we are getting this specific error is because by calling User.get_id(id) , you are calling get_id with self=id and since id...
Read more >id - HTML: HyperText Markup Language - MDN Web Docs
The id global attribute defines an identifier (ID) which must be unique in the whole document. Its purpose is to identify the element...
Read more >HTML - The id attribute - W3Schools
The HTML id attribute is used to specify a unique id for an HTML element. You cannot have more than one element with...
Read more >'NoneType' object has no attribute 'id' - asdeasoft.net
AttributeError means that there was an Error that had to do with an Attribute request. In general, when you write x.y, y is...
Read more >Links in HTML documents - W3C
The id and name attributes share the same name space. This means that they cannot both define an anchor with the same name...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am currently converting the templates for a large website to kotlinx.html. Those templates are using id and also class attributes a lot. Being able to add classes as a parameter but not the id, feels very inconsistent and unsexy.
In a new project I would try to minimize using id attributes, hence this will not be a big issue. But for converting existing projects, it is a big pain.
Hi, just had a similar confusion and came up with this helper function for divs which allows specifying arbitrary attributes:
What do you think? I find the pattern a bit more intuitive (especially for people less familiar with Kotlin) than accessing fields of the tag object via extension method magic.