custom data attribute - Why does Safari fail to access this.dataset.something in my code? -
class menuitem extends htmlelement { constructor() { super() this.menuitemid = this.dataset.menuitemid this.name = this.dataset.name this.price = this.dataset.price this.imgurl = this.dataset.imgurl this.count = this.dataset.count console.trace(this.dataset) console.trace(this.dataset.count) } }
the weird thing this.dataset outputs:
domstringmap count: "0" imgurl: "https://s3-ap-southeast-1.amazonaws.com/ghm-pos/assets/nasi_goreng.jpg" menuitemid: "asdf009" name: "nasi goreng" price: "8.20"
but this.dataset.count outputs null
anyone know why?
Comments
Post a Comment