Hi there. The short answer is: yes, you can. However, you shouldn't for some reasons:
browsers don't recognize it (although you can still access them via JavaScript)
html has the "data" attribute, which exists specifically so that custom attributes can be used. i.e data-myAttr="myVal". Both CSS and JS have access to data attributes.