Files
freeCodeCamp/curriculum/challenges/spanish/01-responsive-web-design/basic-html-and-html5/add-placeholder-text-to-a-text-field.spanish.md

72 lines
2.2 KiB
Markdown
Raw Normal View History

2018-10-08 13:34:43 -04:00
---
id: bad87fee1348bd9aedf08830
title: Add Placeholder Text to a Text Field
challengeType: 0
videoUrl: ''
2018-10-10 16:20:40 -04:00
localeTitle: Añadir texto de marcador de posición a un campo de texto
2018-10-08 13:34:43 -04:00
---
## Description
<section id="description"> El texto de marcador de posición (<code>placeholder</code> ) es lo que se muestra en su elemento <code>input</code> antes de que su usuario haya ingresado algo. Puede crear texto de marcador de posición de la siguiente manera: <code>&lt;input type=&quot;text&quot; placeholder=&quot;this is placeholder text&quot;&gt;</code> </section>
2018-10-08 13:34:43 -04:00
<section id="instructions"> Establezca el valor del <code>placeholder</code> de su elemento <code>input</code> texto en &quot;URL de foto de gato&quot;. </section>
2018-10-08 13:34:43 -04:00
## Tests
<section id='tests'>
```yml
tests:
- text: Agregue un atributo <code>placeholder</code> al elemento <code>input</code> existente.
2018-10-08 13:34:43 -04:00
testString: 'assert($("input[placeholder]").length > 0, "Add a <code>placeholder</code> attribute to the existing text <code>input</code> element.");'
- text: Establezca el valor de su atributo <code>placeholder</code> en "cat photo URL".
2018-10-08 13:34:43 -04:00
testString: 'assert($("input") && $("input").attr("placeholder") && $("input").attr("placeholder").match(/cat\s+photo\s+URL/gi), "Set the value of your placeholder attribute to "cat photo URL".");'
- text: El elemento <code>input</code> completado debe tener una sintaxis válida.
2018-10-08 13:34:43 -04:00
testString: 'assert($("input[type=text]").length > 0 && code.match(/<input((\s+\w+(\s*=\s*(?:".*?"|".*?"|[\^"">\s]+))?)+\s*|\s*)\/?>/gi), "The finished <code>input</code> element should have valid syntax.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='html-seed'>
```html
<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>
<input type="text">
</main>
2018-10-10 16:20:40 -04:00
2018-10-08 13:34:43 -04:00
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>