The browser wont care. Most (if not all browsers) just ignore illegal attributes. If you try to validate it, it WILL fail however. What you need to do is figure out if you're OK with this. If you are just keep the doctype. If not change the doctype. One thing to note is that even if you keep the doctype and the illegal attribute it wont impact your site in any way that it doesnt validate.
In fact your markup might still validate if the data attribute is being added after the page loads - which means that at the point the validation occurs the data attribute wont be there.