HTMLタグ

metaタグ

<head>タグと<title>の間

expries ページ保存期限、GMT時間フォーマット

<meta http-equiv="expries" content="Wed, 26 Feb 2012 08:21:57 GMT"/>

pragma ローカルのcacheから読めない、「オフライン作業」が効かない

<meta http-equiv="pragma" content="no-cache"/>

refresh 秒単位でページを再読み込む

<meta http-equiv="refresh" content="5; url="http://www.google.com"/>

set-cookie クッキー設定

<meta http-equiv="set-cookie" content="cookievalue=xxx;expires=Wed, 26 Feb 2012 08:21:57 GMT;path=/"/>

window-target ページ開く方式(_top, _parent, _self)

<meta http-equiv="window-target" content="_top"/>

content-type charタイプ

<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>

content-language 言語設定

<meta http-equiv="content-language" content="ja-jp"/>

keywords 検索エンジン用キーワード

<meta name="keywords" content="book,love,food"/>

description 検索エンジン用紹介文

<meta name="description" content="This page is about me."/>

robots 検索エンジンに設定(all, none, index, noindex, follow, nofollow)

<meta name="robots" content="none"/>

author 作者

<meta name="author" content="anyuhome.liu@gmail.com"/>

iPhone用フルスクリーン表示設定

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

スマートフォンWeb用

<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<meta name="HandheldFriendly" content="true">

baseタグ

<head>

<base href="http://www.example.com/store/">

</head>

<body>

<img src="img/aaa.jpg" />

<a href="home.php">Home</a>

<a href="products/iphone.php">iPhone</a>

</body>

★HTML5 Embedded Media

<video poster="images/preview.png" width="1280" height="720" controls="controls" preload="none">

<source src="media/video.mp4" type="video/mp4"></source>

<source src="media/video.webm" type="video/webm"></source>

<source src="media/video.ogg" type="video/ogg"></source>

</video>

<audio controls="controls" preload="none">

<source src="music.ogg" type="audio/ogg">

<source src="music.mp3" type="audio/mpeg">

</audio>

formタグ

method get/post

action URL

enctype デフォルト:application/x-www-url-encoded、アップロード:multipart/form-data

accept MIMEタイプ

accept-charset エンコード

inputタグ

<input type="button" />

<input type="checkbox" />

<input type="file" />

<input type="hidden" />

<input type="image" />

<input type="password" />

<input type="radio" />

<input type="reset" />

<input type="submit" />

<input type="text" />

<input type="datetime" />

<input type="datetime-local" />

<input type="date" />

<input type="month" />

<input type="time" />

<input type="week" />

<input type="number" />

<input type="range" />

<input type="email" />

<input type="url" />

<input type="search" />

<input type="tel" />

<input type="color" />

selectタグ

optionタグ

textareaタグ

rows

cols

テキストボックス

var user = document.forms['formX'].elements['user'].value;

var pass = document.forms['formX'].elements['pass'].value;

或いは

var user = document.formX.user.value;

var pass = document.formX.pass.value;

ラジオボタン

var isChecked = document.formX.radioX[0].checked;

チェックボックス

var sel = '';

for (var i = 0 ; i < document.formX.checkboxX.length ; i++){

if (document.formX.checkboxX[i].checked){

sel += document.formX.checkboxX[i].value + '\n';

}

}

セレクトボックス

var sel = '';

for (var i = 0 ; i < document.formX.selectX.options.length ; i++){

if (document.formX.selectX.options[i].selected){

sel +=

document.formX.selectX.options[i].index

+ ':'

+ document.formX.selectX.options[i].text;

}

}

選択内容を追加

document.formX.selectX.options[0] = new Option(text, value);

選択内容を削除

document.formX.selectX.options[0] = null;

<form name="formX">

user <input type="text" name="user" /><br>

pass <input type="text" name="pass" /><br>

<input type="radio" name="radioX" />選択1<br>

<input type="radio" name="radioX" />選択2<br>

<input type="checkbox" name="checkboxX" value="1" /> AAA<br>

<input type="checkbox" name="checkboxX" value="2" /> BBB<br>

<select name="selectX">

<option>CCC</option>

<option>DDD</option>

</select>

<input type="submit" value="LOGIN" />

</form>