Created
January 24, 2015 13:13
-
-
Save yuily/e118ecfad62a9c7daf02 to your computer and use it in GitHub Desktop.
【JavaScript】文字列の結合とinnerHTML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
target = document.getElementById("output"); | |
//セレクトボックス、日付、金額を文字列結合 | |
var f = document.kirokubox.utilityCharges; | |
for(var i = 0 ; i < f.options.length ; i++){ | |
if(f.options[0].selected){ | |
target.innerHTML = ('<pre class="output_hizuke">今月の'+ f.options[0].value +'料金</pre>'+'<pre class="output_kingaku">●'+ lastmonth + "月" + day + "日~"+ month + "月" + day + "日 " + ryoukin +"円</pre>"); | |
} else if(f.options[1].selected) { | |
target.innerHTML = ('<pre class="output_hizuke">今月の'+ f.options[1].value +'料金</pre>'+'<pre class="output_kingaku">●'+ lastmonth + "月" + day + "日~"+ month + "月" + day + "日 " + ryoukin +"円</pre>"); | |
} else if(f.options[2].selected){ | |
target.innerHTML = ('<pre class="output_hizuke">今月の'+ f.options[2].value +'料金</pre>'+'<pre class="output_kingaku">●'+ twomonth + "月" + day + "日~"+ month + "月" + day + "日 " + ryoukin +"円</pre>"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment