Get value from Javascript to HTML in Laravel

Get value from Javascript to HTML in Laravel

I want to ask that how can I call a value from javascript to html blade in laravel.

I want to ask that how can I call a value from javascript to html blade in laravel.

Here is my JavaScript code:

<script type="text/javascript">
    function valueFunction(){
        var output = document.getElementById('teacherId').value;
        console.log(output);
        document.getElementById('output').innerHTML = output;
    }
</script>

Here is my Laravel Html:

{{$users[]->name}}
<output id="output"></output>

As I am getting the value in output tag, but I want to call the value of javascrpt in {{$users[output]->name}} here.

Thank you.

javascript html css laravel

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Create JavaScript carousel with HTML, CSS and JavaScript

Learn how to create JavaScript carousel with HTML, CSS and JavaScript. Learn how to create a JavaScript slider step by step. Now many people will just download a library to create a JavaScript carousel or JavaScript slider.

Countdown with HTML, CSS, and JavaScript / How to create JavaScript Countdown

Countdown with HTML, CSS, and JavaScript / How to create JavaScript Countdown. W will build a Responsive Website with HTML, CSS, and JavaScript

CSS Button Generator (Mini) using HTML, CSS, and JavaScript

Learn how to create a mini CSS Button generator just by using HTML, CSS, and JavaScript. We will only cover some properties related to the button but you can use other properties to allow users to play around with different styles and designs.

Animated Counter using JavaScript with HTML, CSS | JavaScript Counter Animation

In this video, you'll see Animated Counter using JavaScript with HTML CSS

CSS3 Clip-path Transform Effects on Scroll with Video Background | Html CSS Vanilla Javascript

CSS3 Clip-path Transform Effects on Scroll with Video Background | Html CSS Vanilla Javascript