こんにちは、誰かが私を助けてくれるかどうか疑問に思っています。以下のコードを統合してください。コードの行数を減らすことができるはずですが、これを実現する方法がわかりません。
$(document).ready(function () {
$(".question1").hover(function () {
$(this).append('<div class="tooltip"><p>1This is a tooltip. It is typically used to explain something to a user without taking up space on the page.</p></div>');
}, function () {
$("div.tooltip").remove();
});
$(".question2").hover(function () {
$(this).append('<div class="tooltip"><p>2This is a tooltip. It is typically used to explain something to a user without taking up space on the page.</p></div>');
}, function () {
$("div.tooltip").remove();
});
$(".question3").hover(function () {
$(this).append('<div class="tooltip"><p>3This is a tooltip. It is typically used to explain something to a user without taking up space on the page.</p></div>');
}, function () {
$("div.tooltip").remove();
});
});