Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Web分科会 第11回 実習
<!DOCTYPE html>
<title>Ajax Test</title>
<link rel="stylesheet" href="">
<script src=""></script>
<script src=""></script>
const template = ({url = '', imageUrl = '', title = '', date = '201-11-02', views = 0}) => `
<div class="ui card">
<div class="image">
<img src="${imageUrl}">
<div class="content">
<a class="header" href="${url}">${title}</a>
<div class="extra content">
<a class="right floated created">${date}</a>
<a class="views"><i class="users icon"></i>${views}</a>
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('search-button').addEventListener('click', () => {
const text = document.getElementById('search-text').value;
// ここにボタンを押した時の処理を書く
// 結果を表示するには
document.getElementById('result').innerHTML = '<strong>Hello!</strong>';
<div class="ui container">
<h1 style="margin-top: 2em">TSG Photo Searcher</h1>
<div class="ui action left icon input">
<i class="search icon"></i>
<input id="search-text" type="text" name="name">
<button id="search-button" class="ui button">Search</button>
<div style="margin-top: 3em">
<div id="result" class="ui four cards">
<!-- ここにデータを突っ込む -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.