Sp 127

From Htmlpedia
Jump to: navigation, search

OpenSP: Required attribute ... not specified

Cause:

An attribute is required on an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types, the type attribute is required on the script element and the alt attribute is required for the img element.

Example:

Sample: required attribute type not specified. The <script> element has a required attribute type. (The language attribute is deprecated.)

Bad<script language="JavaScript">
Good<script type="text/javascript">

Sample: required attribute type not specified. The <style> element has a required attribute type.

Bad<style>
Good<style type="text/css">

Sample: required attribute alt not specified. The <img> element has a required attribute alt.

Bad<img src="image.png" width="100" height="50">
Good<img src="image.png" width="100" height="50" alt="Short description of the image">

Solution:

Check the definition of the element. Look for the required attributes and add any that are not present.

References: