0
내가 jQuery를 사용하고 난 변수에 텍스트 추가해야합니다변수에 텍스트를 추가하려면 어떻게해야합니까?
$("document").ready(function(){
var i="this is text";
$(i).append("aa");
alert(i);
})
내가 jQuery를 사용하고 난 변수에 텍스트 추가해야합니다변수에 텍스트를 추가하려면 어떻게해야합니까?
$("document").ready(function(){
var i="this is text";
$(i).append("aa");
alert(i);
})
당신은 물론이
$.fn.appendString = function(str) {
return this.selector + str;
}
$(document).ready(function(){
var i = "this is text";
alert($(i).appendString("aa"));
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
$("this is text")
정말 유효 아무것도하지하는 것으로
그러나이 concantenating 것 문자열
var i = "this is text";
i = i + "aa"; // it's now "this is textaa"
, jQuery를하지 진짜로 였는지를 문자열
(HTTP [I가에 대한 jQuery 플러그인 있다고 생각] : //i.stack가. imgur.com/ssRUr.gif) – JJJ
@Juhana - 그 중 하나를 찾고 있었는데 완벽하게 맞는 것 같습니다! – adeneo
@Juhana 당신은 플러그인을 필요로하지 않습니다. 그것은 단지 문자열을 연결하는 것입니까? – rottenoats