Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7189535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:19:23+00:00 2026-05-28T19:19:23+00:00

I asked a question a bit back and got some useful advice. I am

  • 0

I asked a question a bit back and got some useful advice. I am trying to make a sortable list that allows the user to add a youtube url to the list. I have it set to take the id and put it in an array, I then want it to use the following javascript to append the video url and a “cue” link to the list:

    _videoId = _videoUrl.replace(/^[^v]+v.(.{11}).*/,"$1");
//place the Videoid in an array
_videoList[_videoList.length] = _videoId;
var $new_element = document.createElement('li');
//set the id of the li element to match it's position in the array
var refId = _videoList.length;
$new_element = $('li').attr('id', refId);
var $link = $('a')
.attr('href', _videoUrl)
.innerHtml(_videoUrl)
.data('refId', refId) // add parent li's id for reference in click event
.appendTo( $new_element )
.bind( 'click', function(){
    cue( $link.data('refId') );
    return false; // prevent browser's default click event
});

$new_element.appendTo( container );

However it is giving me an error (in chrome)

Object [object Object] has no method ‘innerHtml’

my HTML looks like this:

<div id="hostPanel">
        <div id="videoList">
        <ul id="sortable">

        </ul>
        </div>

Any help on getting this to work could be nice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:19:24+00:00Added an answer on May 28, 2026 at 7:19 pm

    innerHtml is a property of DOM-elements, not a method of jQuery-objects. Use html() instead.


    Edit:

    Regarding to the comment:

    $new_element = $('li').attr('id', refId);
    

    This doesn’t create a new <li>-element, it takes the existing <li>-elements inside the document.

    To create a new element in jQuery use

    $new_element = $('<li/>').attr('id', refId);
    

    It’s the same here:

    var $link = $('a')
    

    …has to be

    var $link = $('<a/>')
    

    Don’t mix jQuery and Javascript(DOM)

    This is the Javascript(DOM)-way to create an element:

    var $new_element = document.createElement('li');
    

    jQuery expects markup for $() while the DOM-method createElement() expects a tagName as parameter .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(I asked this question in another way , and got some interesting responses but
I asked a question yesterday on here and got some awsome help, but I
I asked a question on here earlier and got some fantastic responses. I've since
I asked similar question before and got some nice code, but i'm concerned with
I know this question has been asked a bit before. But looking around I
I don't think this question has been asked before. I'm a bit confused on
I asked this question a while back but now I'm looking to implement an
I recently asked a question about some problems I was having getting MIT Kerberos
This Question arises from a Q&A here I have some doubts that i think
I've kind of asked this question earlier so sorry for asking a bit similar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.