input 탭의 type에 여러 text나hidden을 지정하면 어느 것이 우선입니까?
6691 단어 HTML
개시하다
input
태그의 type
속성에 여러 값을 지정하면 어떻게 되는지 궁금해서 검증했습니다.소스 코드
index.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
</head>
<body>
<form method="post" action='sample.php'>
<input type='text' name='sample1' value="text"><br>
<input type='hidden' name='sample2' value="hidden"><br>
<input type='password' name='sample3' value="password"><br>
<input type='url' name='sample4' value="http://url.url"><br>
<!-- ここからミックス -->
<input type='text hidden' name='sample5' value="text hidden"><br>
<input type='hidden text' name='sample6' value="hidden text"><br>
<input type='text password' name='sample7' value="text passowrd"><br>
<input type='password text' name='sample8' value="password text"><br>
<input type='text url' name='sample9' value="text url"><br>
<input type='url text' name='sample10' value="url text"><br>
<input type='hidden hidden' name='sample11' value="hidden hidden"><br>
<input type='text hidden passowrd url' name='sample12' value="text hidden password url"><br>
<button type='submit'>送信</button><br>
</form>
</body>
</html>
sample.php<?php
echo('<pre>');
var_dump($_POST);
echo('</pre>');
결실
스크린
우편함 가격
고찰하다.
text hidden
화면에 표시되므로 hidden
유효하지 않음hidden text
그러나 hidden
는 작용하지 않는다password
의 속성도 마찬가지password
가 작용하지 않는다(입력란의 없음 ● ● 그런 복자)url
할 수 있기 때문에 속성도 작용하지 않는다결론
type에서 여러 속성을 지정할 수 없습니다.
생각해보면 당연한 일
type='hidden'
이지만 type='hidden url'
준비가 되지 않아 무효로 판단되는 속성이 기본값이 된다.이를 통해 알 수 있듯이
input
의 기본값type
이 text
이기 때문에 조합이 지정한 모든 것을 text
의 행위로 표시한다.신뢰할 수 있음
참고 자료
type 속성 일람은 여기를 참조합니다.
http://honttoni.blog74.fc2.com/blog-entry-138.html
Reference
이 문제에 관하여(input 탭의 type에 여러 text나hidden을 지정하면 어느 것이 우선입니까?), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/yamamoto_hiroya/items/ffe95439c42f02e490da텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)