Get and Send value of input field inside an Iframe

Get value of input field inside an iframe and Send value to input field inside an iframe from of the another input...



    <iframe name='inpIframe' id="inpIframeId" src="examples/iframe/iframe_page.html" width="100%" height="150"></iframe>
<!-- This iframe has local path so, please attached here your server path. -->

    <input type='button' name='get-valOf-iframe' value='Get value of Iframe'>
    <input type="text" id="inputBox" value="Input outside an iframe">
    <input type='button' name='send-valTo-iframe' value='Send value to Iframe'>


        iframe[name=inpIframe] { 
                border:solid 1px gray; 


    $('input:button[name=get-valOf-iframe]').click(function() {
        var getIframeVal = $('iframe[name=inpIframe]').contents().find('#iframeInputBox').val();
        document.getElementById('inputBox').value = getIframeVal;
    $('input:button[name=send-valTo-iframe]').click(function() {
        var getInpVal = $('#inputBox').val();

Copyright 2024 by All Rights Reserved.