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 7960149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:40:59+00:00 2026-06-04T04:40:59+00:00

Learning how to use Phonegap to create an Android application I am still experimenting

  • 0

Learning how to use Phonegap to create an Android application I am still experimenting with the fundamentals of HTML and JavaScript. Trying to add a button, I must have done something fundamentally wrong…

this is my body element:

<div data-role="page">
    <div data-role="header">
        <h1>My Title</h1>
    </div>
    <div data-role="content" id="divContent">   
        <p id="content"></p>
    </div>
</div>

To start with I have some basic functionaloty. I have a databasequery (it works) and the result should produce some text and a button:

if(results.rows.item(0).c == 0){
    document.getElementById("content").innerHTML=
        "You don't have any service items ....etc";
    var btn = document.createElement("newItem");
    btn.setAttribute("type", "button");
    btn.setAttribute("value", "AAARGH!");
    btn.setAttribute("name", "btnNew");
    document.getElementById("divContent").appendChild(btn);
}

The text is displayed, the button is not and I cannot understand why. From what I have read this is the way to create a button with JavaScript.

Full source is available here: http://code.google.com/p/easy-service/source/browse/trunk/EasyService-Common/app/app.html

  • 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-06-04T04:41:00+00:00Added an answer on June 4, 2026 at 4:41 am

    You need to create the button node like this:

    var btn = document.createElement("input");
    

    The parameter you’re passing in is the type of element– in this case, we want an input element.

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

Sidebar

Related Questions

I'm learning to use raw sockets, and im trying to prase out the tcp
I am very new to MVC. I've been learning to use plain HTML or
I'm learning to use GWT 2.0 and I'm trying to convert the StockWatcher demo
I'm learning to use the write function and am trying to print only a
Ok I am learning to use databases in android and have follow several tutorials
I've been learning Android and Phonegap development from mainly these two sources: http://news.softpedia.com/news/How-to-Run-Android-Applications-on-Ubuntu-115152.shtml http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart
I'm currently learning to use Core Data on iOS , in my test application
I'm learning to use Allegro. I'm trying to make my character cut out. How
I'm learning to use object literals in JS, and I'm trying to get a
I am learning use VS 2008 setup project to create MSI installer for our

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.