Store user input in a paragraph

I want to create a unique program that allows users to input text in a field, and when they click "Start", the text will appear in a paragraph backwards. I plan to use Html, jQuery, and CSS for this project. Can anyone provide guidance on how to achieve this?

Below is the HTML code:

<!DOCTYPE html>
<html id="head">
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="BackTalk.js"></script>
    <link rel="stylesheet" type="text/css" href="BackTalk.css">
    <title>BackTalk</title>
</head>
<body id="body">
    <div id="Main">
        <form>
            <input id="input" type="number" value="Start">
            <button id="input2"  onclick="">Start</button>
        </form>
    </div>
    <form id="frm">
        <p id="para"></p>
    </form>
</body>
</html>

And here's the JavaScript (the main part where assistance is needed):

$(document).ready(function () {
    $('#input2').click(function () {
    });
});

CSS section (might be necessary):

#head {
}

#body {
    background-image: url('stardust.png');
}

#Main {
    width: 230px;
    padding: 10px;
    border: 1px double #ffffff;
    border-radius: 10px;
    margin: auto;
}

#frm {
    width: 230px;
    height: 500px;
    padding: 10px;
    border: 1px double #ffffff;
    border-radius: 10px;
    margin: auto;
}

#input {
    border-radius: 10px;
}

#input2 {
    border-radius: 10px;
}

Answer №1

Give this a shot http://jsfiddle.net/UniqueUser123/abcdefg/

 $('#button').click(function () {
  var userInput=$('#inputField').val();
  console.log($('#outputParagraph').text(userInput.split("").reverse().join("")));
 });

Answer №2

Unsure if this is precisely the solution you are seeking:

$(document).ready(function () {
    $('#buttonClick').click(function () {
        $('#result').text($('#textInput').val().split('').reverse().join(''));
    });
});

JSFiddle Link

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Guide to implementing CRUD operations on a remote MongoDB using Node.js

Recently, I delved into the world of NodeJS and discovered its server-side capabilities. My current project involves interacting with MongoDB on a remote server using the nodejs mongodb driver. With just a few lines of code, I am able to connect to the dat ...

Utilizing a StyledComponents theme within a Component

When creating a style called Link, the theme is contained inside of this.props. How can the theme be extracted from props and passed into the Link styled component? Error: ReferenceError - theme is not defined import React from 'react'; impo ...

Pulling out a particular row from an HTML table with the help of HTML::TreeBuilder

I am a beginner in perl programming and I am facing a major challenge. I need to parse an HTML file that contains a single table, and extract a specific row based on one of its column entries. Here is a snippet of the HTML file: many previous rows descri ...

Issue with organizing columns in Plotly-Dash using personalized CSS

I expected the code below to create three adjacent drop-down menus under a tab labeled Setup, but I'm actually seeing them stacked on top of each other. What mistake am I making? Any guidance would be highly appreciated! I've provided the releva ...

Adaptable placement of background across screen widths

I am facing an issue with three buttons that have the same height and width, text, and background icons on the right. On small screens or when there is only a single word in the button, I want to move the icons to the bottom center of the button. Is there ...

Changing the color of a menu item in Bootstrap when a modal window is closed: A guide

I am implementing Twitter Bootstrap and attempting to launch a modal popup by clicking on a menu item. Below is the code snippet: <div class="navbar navbar-fixed-bottom"> <div class="navbar-inner"> <ul class="nav pull-right"> ...

Ways to include multiple pieces of data in a JQuery Mobile List view

Obtaining JSON data (list of available Hotels within a certain distance) and extracting the following information in JSON format: Name of Hotels, Distance of Hotel from our current location, number of rooms. There might be multiple Hotels within the specif ...

When using Vuejs + Laravel to make an Ajax request, only the most recent information entered into the view is submitted

Can someone guide me on implementing a basic ajax request using Vue with my Laravel backend? I have a boolean field called completed in a table named courses. In the view, users can see all assigned courses and toggle their completion status by pressing a ...

Creating an interactive dropdown menu that automatically fills a text field based on user selections using a combination of AJAX,

Looking for a tutorial or code that can dynamically populate a textfield with a selected value from a dropdown using AJAX or jQuery in combination with PHP. Similar to the scenario depicted in the image... ...

Troubleshooting Azure typescript function: Entry point for function cannot be determined

project structure: <root-directory> ├── README.md ├── dist ├── bin ├── dependencies ├── host.json ├── local.settings.json ├── node_modules ├── package-lock.json ├── package.json ├── sealwork ...

Laravel Mix fails to recognize VueJs integration in Laravel

Having an issue setting up VueJs with laravel 5.7 and mix where it keeps saying VueJs is not detected. I've already executed the npm install command. Below is my welcome view: <!doctype html> <html lang="{{ str_replace('_', '- ...

Google Extension PHP Plugin

Is it feasible to integrate a PHP file into a Google Extension for Chrome? I've been exploring the idea of creating an extension and most resources only mention HTML, CSS, and JavaScript. Any guidance on using PHP in the extension would be highly valu ...

Invoking a nested function within an array

I need to trigger a function with a button click. The function I want to call is nested within another function, which is part of an array. demo = { volej: function(param) { (new initChartist).users(param); }, initPickColor: function(){ ...

There is a missing template at the specified location: index.html in Django

Hello, I recently created a new project and placed the index.html file in the templates directory. However, when I run the server, I encountered an error message stating TemplateDoesNotExist at /. Can anyone point out what mistake I might have made? Below ...

Topaz font does not properly display backslashes and certain characters when rendered on Canvas

Who would have thought I'd stumble upon a new challenge on Stack Overflow? But here we are. If there's already a solution out there, please guide me in the right direction. I'm currently developing an interactive desktop environment inspired ...

Creating a loader for a specific component in Angular based on the view

Creating a loader for each component view is crucial when loading data from an API. Here is the current structure of my components within my <app-main></app-main>: <app-banner></app-banner> <app-data></app-data> <app ...

Employing jQuery to attach a new div to a dynamically generated div following a successful AJAX request

Currently, I am utilizing the marvelous WP-Polls plugin for WordPress, which boasts an innovative AJAX polling system. My main objective is to append a hidden div (.comment-block) to a fresh div (.voted) that will be dynamically injected into the DOM by th ...

The video is not displaying on my website

I recently added a video to my webpage that is 3:48 minutes long. However, even though I have the navigation bar and sound in place, the video does not seem to be displaying properly. Here is an image of how it appears: https://i.stack.imgur.com/HeN41.png ...

What is the best way to manage a file upload process?

What is the process for handling a file uploaded through curl in an express js action/route? router.route('/images') .post (function(req, res) { res.status(200); res.json({ message: 'file uploaded' }); }); app.u ...

The div element moves to the right as soon as the drop-down menu pops up

Currently, I am facing an issue with aligning an image inside a div that is centered in an outer-wrapper. The outer-wrapper contains a horizontal menu at the top with 5 sub divs displayed inline. I have implemented CSS for a drop-down menu that appears whe ...