خرید بک لینک

Vote count: 0

I have a jsfiddle here: https://jsfiddle.net/gemcodedigitalmarketing/zn5yLwh3/

What I want is the text in the customText input to be appended to the canvas. Though I am unsure as to why this is not working.

It works when I tried yesterday to append td and tr to a table. But maybe because its a canvas it needs a different way of adding text?

not sure... either way i would apprecaite help.

$('#addText').click(function() {
    var value = $('#customText').val();
    $('canvas').append('<p>' + value + '</p>');
});

This is my jquery at the bottom of the page

<div class="assets">
<h3>Assets</h3>
<div class="text">
    <h4>Text</h4>
    <input id="customText" type="text">
    <button id="addText" class="btn btn-default">Add Text</button>
    <p></p>
</div>
<div class="image">
    <h4>Images</h4>
    <ul class="list-unstyled">
        <!-- List of images here -->
        <!-- <li><img src="images/sample.jpeg" class="img-rounded" /></li> -->
    </ul>
</div>

This is the relevant html.

Hope that gives you guys enough to go on...

asked 3 mins ago

1 Answer

Vote count: -1

In your case canvas is not an element but a class. So you have to use it in the selector as:

$('.canvas')

Don't forget the dot.

answered 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 21 خرداد 1395 ساعت: 16:23

صفحه بندی