文字列の表示|JS課題04
解答
HTML
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>文字列の表示</title> <link rel="stylesheet" type="text/css" media="screen,print" href="style.css" /> </head> <body> <script type="text/javascript" src="index.js"></script> </body> </html>
CSS
.name { color: #f60; font-weight: bold; }
JavaScript
var name = "vinton"; document.write("My name is <span class='name'>" + name + "</span>");