채택완료

자바스크립트질문입니다

<input type="button" class="minibutton" value="大阪市" onclick="location.href='third';">
<input type="button" class="minibutton" value="おすすめタグ" onclick="location.href='third';">
<input type="button" class="minibutton" value="エリアで絞り込む" onclick="location.href='third';">
<input type="button" class="minibutton" value="検索" onclick="location.href='third';">
<input type="button" class="minibutton" value="その他" onclick="location.href='third';">

이 버튼들을 자바스크립트로 나열 할 수 있나요? 모든페이지에 중복되어서, 자바스크립트로 처리하려고합니다

|

답변 1개

채택된 답변
+20 포인트
Copy
<script>
    var str = "<input type=\"button\" class=\"minibutton\" value=\"大阪市\" onclick=\"location.href='third';\"> <input type=\"button\" class=\"minibutton\" value=\"おすすめタグ\" onclick=\"location.href='third';\"> <input type=\"button\" class=\"minibutton\" value=\"エリアで絞り込む\" onclick=\"location.href='third';\"> <input type=\"button\" class=\"minibutton\" value=\"検索\" onclick=\"location.href='third';\"> <input type=\"button\" class=\"minibutton\" value=\"その他\" onclick=\"location.href='third';\">";
    document.write(str);
</script>

답변을 작성하려면 로그인이 필요합니다.