2.1 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			2.1 KiB
		
	
	
	
	
	
	
	
id, title, challengeType, videoUrl, localeTitle
| id | title | challengeType | videoUrl | localeTitle | 
|---|---|---|---|---|
| bad87fee1348bd9aedc08830 | Use HTML5 to Require a Field | 0 | استخدم HTML5 لطلب حقل | 
Description
required داخل عنصر input ، مثل: <input type="text" required> Instructions
input النص الخاص بك حقلًا required ، بحيث لا يمكن للمستخدم إرسال النموذج بدون إكمال هذا الحقل. ثم حاول إرسال النموذج دون إدخال أي نص. انظر كيف يعلمك نموذج HTML5 أن هذا الحقل مطلوب؟ Tests
tests:
  - text: يجب أن يحتوي عنصر <code>input</code> النص على السمة <code>required</code> .
    testString: 'assert($("input").prop("required"), "Your text <code>input</code> element should have the <code>required</code> attribute.");'
Challenge Seed
<h2>CatPhotoApp</h2>
<main>
  <p>Click here to view more <a href="#">cat photos</a>.</p>
  <a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="/submit-cat-photo">
    <input type="text" placeholder="cat photo URL">
    <button type="submit">Submit</button>
  </form>
</main>
Solution
// solution required