たとえば、次のような入力ボックスがあるとします。
<input id="fuzzyname" value="" placeholder="&Fuzzybear">
その入力ボックスをクリックすると、 & の後にカーソルが置かれ、プレースホルダーが入力ボックスの値になるように、javascript/JQuery を使用したいと考えています。
これは私がこれまでに持っているもののようなものです:
$("#fuzzyname").focus(function () {
var value = $(this).attr("placeholder");
var symbol = "&";
var cursorIndex = value.indexOf(symbol);
//This is where I want to output the value into the inputbox with the cursor after cursorIndex
});