0415 Javascript
今学校で
ジャバスクリプトの
基礎勉強をしています。
今日は下記の簡単な計算の
プログラミングを作りました。
シニア世代の
ぼけ防止にいいかもね。
興味のある方は
下のテキストを
ファイル保存し、拡張子にhtml
を付けてブラウザ(エクスプローラー)で
ひらいてみてください。
簡単な電卓になります。
結構面白い。
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<style type="text/css">
<!--
.right{
text-align:right;
}
-->
</style>
<script type="text/javascript">
<!--
function goukei(){
moneyin1=parseInt(document.form1.text1.value);
moneyin2=parseInt(document.form1.text2.value);
moneyin3=parseInt(document.form1.text3.value);
moneyin4=parseInt(document.form1.text4.value);
moneyin5=parseInt(document.form1.text5.value);
document.form1.text6.value=moneyin1+moneyin2+moneyin3+moneyin4+moneyin5;
}
function zeikomi(){
hontai=document.form1.text6.value;
zei=document.form1.text7.value;
document.form1.text8.value=hontai*(1+5/100);
}
-->
</script>
<title>簡単計算機</title>
</head>
<body>
<font color="blue">
<h1>簡単計算機</h1></font>
<hr>
<h2>収入計算</h2>
<form name="form1">
<p>収 入 <input type="text" value="0" class="right" name="text1">円</p>
<p>収 入 <input type="text" value="0" class="right" name="text2">円</p>
<p>収 入 <input type="text" value="0" class="right" name="text3">円</p>
<p>収 入 <input type="text" value="0" class="right" name="text4">円</p>
<p>収 入 <input type="text" value="0" class="right" name="text5">円</p>
<p>合 計 <input type="text" value="0" class="right" name="text6" onfocus="goukei()">円</p>
<p>消費税率 <input type="text" value="5" class="right" name="text7">%</p>
<p>税込金額 <input type="text" value="0" class="right" name="text8" onfocus="zeikomi()">円</p>
<hr>
</form>
</body>
</html>
ジャバスクリプトの
基礎勉強をしています。
今日は下記の簡単な計算の
プログラミングを作りました。
シニア世代の
ぼけ防止にいいかもね。
興味のある方は
下のテキストを
ファイル保存し、拡張子にhtml
を付けてブラウザ(エクスプローラー)で
ひらいてみてください。
簡単な電卓になります。
結構面白い。
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<style type="text/css">
<!--
.right{
text-align:right;
}
-->
</style>
<script type="text/javascript">
<!--
function goukei(){
moneyin1=parseInt(document.form1.text1.value);
moneyin2=parseInt(document.form1.text2.value);
moneyin3=parseInt(document.form1.text3.value);
moneyin4=parseInt(document.form1.text4.value);
moneyin5=parseInt(document.form1.text5.value);
document.form1.text6.value=moneyin1+moneyin2+moneyin3+moneyin4+moneyin5;
}
function zeikomi(){
hontai=document.form1.text6.value;
zei=document.form1.text7.value;
document.form1.text8.value=hontai*(1+5/100);
}
-->
</script>
<title>簡単計算機</title>
</head>
<body>
<font color="blue">
<h1>簡単計算機</h1></font>
<hr>
<h2>収入計算</h2>
<form name="form1">
<p>収 入 <input type="text" value="0" class="right" name="text1">円</p>
<p>収 入 <input type="text" value="0" class="right" name="text2">円</p>
<p>収 入 <input type="text" value="0" class="right" name="text3">円</p>
<p>収 入 <input type="text" value="0" class="right" name="text4">円</p>
<p>収 入 <input type="text" value="0" class="right" name="text5">円</p>
<p>合 計 <input type="text" value="0" class="right" name="text6" onfocus="goukei()">円</p>
<p>消費税率 <input type="text" value="5" class="right" name="text7">%</p>
<p>税込金額 <input type="text" value="0" class="right" name="text8" onfocus="zeikomi()">円</p>
<hr>
</form>
</body>
</html>
0414 天候
寒さが戻って来ましたね。
風が吹き荒れ
ベランダに置いあるスリッパが
行方不明になったり
じょうろが畑のほうにころがったり
台風のような状態です。
日本列島がふたたび
冬に戻ったように感じます。
天候の影響は即、野菜の値段に
跳ね返ってきます。
東京ではキャベツが
ひと玉400円で売られている
ニュースを見ました。
日照時間にあまり左右されない
もやしが今人気らしく
大量に仕入れても
すぐに売れてしまうそうです。
夏野菜の苗を買うのは
もうちょっと後にします。
風が吹き荒れ
ベランダに置いあるスリッパが
行方不明になったり
じょうろが畑のほうにころがったり
台風のような状態です。
日本列島がふたたび
冬に戻ったように感じます。
天候の影響は即、野菜の値段に
跳ね返ってきます。
東京ではキャベツが
ひと玉400円で売られている
ニュースを見ました。
日照時間にあまり左右されない
もやしが今人気らしく
大量に仕入れても
すぐに売れてしまうそうです。
夏野菜の苗を買うのは
もうちょっと後にします。

