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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:25:28+00:00 2026-06-05T10:25:28+00:00

I have a basic Generator for border radius, where the user types in the

  • 0

I have a basic Generator for border radius, where the user types in the number of their choice and it inserts the number into the preview code. However I want to have a preview box that changes according to the number they have inserted. I am half way there but can’t seem to figure out the last bit.

HTML:

<label>Border Radius:</label>
<input name="border-radius" id="jj_input" class="jj_input" type="text" size="2" value='' onkeyup='changeRadius()' />
<span>px</span>

<div class="yourcode">
    <p>border-radius: <span id="radius"></span>px; </p>
    <p>webkit-border-radius: <span id="radius2"></span>px; </p>
</div>

<div id="preview">
    <span class="preview_text">Preview Text</span>
</div>

Javascript:

function changeRadius(){
    var jj_input = document.getElementById('jj_input').value;
    document.getElementById('radius').innerHTML = jj_input;
    document.getElementById('radius2').innerHTML = jj_input;

    document.getElementById('preview').style.borderRadius = 'WHAT_GOES_HERE?' ;
}

Where is says “WHAT_GOES_HERE?”, I want this value to be the same as jj_input.

Any ideas?

  • 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-05T10:25:29+00:00Added an answer on June 5, 2026 at 10:25 am
    document.getElementById('preview').style.borderRadius = jj_input + 'px';
    

    We’re simply assigning the value of element.style.borderRadius to that of jj_input and concatenating in px.

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

Sidebar

Related Questions

I am trying to make a basic border radius generator. I have an input
I have created a code generator for our project to generate a lot of
I have a basic wave generator in java but I need something to remove
I have a number of Python generators, which I want to combine into a
I have basic idea on Kilo Virtual Machine on Mobiles , I have clear
I have basic hello word example of Prime Faces. I have created dynamic web
if I have basic model for keeping track of client art: class ArtEntry(models.Model): client
I have a basic canvas Facebook app with a web template. I tried to
I have a basic PHP script like this: <?php system(/bin/touch /root/testfile); When I run
I have a basic ASP.NET MVC 3 app. I have a basic action that

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.