Using Elements Inside Button Tags: What's Allowed?
No, you cannot use a <div> element inside a <button> tag. The <button> tag is a container element that is used to create clickable buttons for submitting forms or triggering JavaScript functions. It only allows phrasing content, such as text, images, or other inline elements.
However, you can use other elements inside a <button> tag, such as <span>, <i>, or <img>, to enhance the appearance of the button or add additional functionality.
原文地址: https://www.cveoy.top/t/topic/qc1Z 著作权归作者所有。请勿转载和采集!