我要做到這一點,當我點擊飛輪海的性格,它會變成攝氏度character.But不行,怎麼做的?
<html lang="en">
$("a").click(function() {
if ($(this).text() == "℉") {
$(this).html("℃");
} else {
$(this).html("℉");
}
});
<script src="https://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css">
<link rel="stylesheet" href="css/owfont-regular.css">
<a id="toggle" href="javascript:void(0)">℉</a>
'如果($(本)的.text()== '℉')' –