Tuesday, October 13, 2015

HTML :
<br />
<div id="wrapper">
<textarea cols="55" id="text" maxlength="250" name="msg" rows="4"></textarea>
    <input id="submit" name="submit" type="button" value="submit" />
</div>
JS :
jQuery("#wrapper").on("click","#submit",function(){
    var text = $("#text").val();
    var arrs = [];
    var word = /\{(.*?)\}/g;
    for(tags = word.exec(msg_data); tags; tags = word.exec(msg_data)){
        arrs.push(tags[1]);
    }
    alert(arrs);
});

No comments:

Post a Comment