How to get the this??? pointed by a function other than a function in javascript

like the following code,
how do I get the ("- sharpadd_img2") outside ajax () inside ajax (). Change () points to this???
ajax () inside console.log (this). The this output here points to ajax,
how do I make the this of this output point to ("- sharpadd_img2"). Change ()?

$("- sharpadd_img2") .change (function () {
console.log (this)

// , ajax 
var formdata=new FormData();
var add_img2=this.files[0];
 formdata.append("uploadImage",add_img2);
    var str="1111";
    formdata.append("recid",str);
    var title="";
    formdata.append("title",str);
    
    $.ajax({
        url:"/imageText/saveImage.do",
        type:"post",
        contentType:false,
        data:formdata,
       // data:{"title":title,"uploadImage":uploadImage},
        processData:false,
        success:function(info){
            console.log(info);
            // img
            this.siblings(".this_show_img").attr("src",info)
            console.log(this)
        },
        error:function(err){
            console.log(err);
        }
    });

})

Mar.29,2022

Arrow function or var that = this;
and your this > should $(this)


ajax the outer function sets a variable pointing to this
such as var self = this;
$.ajax. Just use this variable in


success: info => {console.log(this)}
.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb4543-69c39.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb4543-69c39.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?