Greetings Pros,

I just want to ask how can i format a certain string to italic. I have this code but it's not working. Well I know it will not work because the array is still in array format not in string yet. Right?

$(document).ready(function() {
        //The demo tag array
        var availableTags = [];
        $.getJSON("{!! URL::to('/') !!}/retrieve/contacts", function(data) {
            $.each(data, function(key, val) {
                availableTags.push(val.dta + " Phone: " + val.phne.italics() + "",;

        //The text input
        var input = $("input#txt");

        //The tagit list
        var instance = $("<ul class=\"tags\"></ul>");

        //Store the current tags
        //Note: the tags here can be split by any of the trigger keys
        //      as tagit will split on the trigger keys anything passed
        var currentTags = input.val();

        //Hide the input and append tagit to the dom

        //Initialize tagit
            fieldName: "items[]",
            allowSpaces: true,
            removeConfirmation: true,
            tagsChanged:function () {

            //Get the tags
                var tags = instance.tagit('tags[]');
                var tagString = [];

            //Pull out only value
                for (var i in tags) {

            //Put the tags into the input, joint by a ','

And also how can i use this code in my case:

.replace('/ Phone: /g', '');

i want to remove the phone after the user selects it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.