ASP.net Step Through/ Line break in Javascript

Hi. I am fairly new to JavaScript. How do I step through JavaScript and put line breaks in.
My code resides in an ASP.net VB.net web app

<script type="text/javascript">
        //variable that will store the id of the last clicked row
        var previousRow;
        
        function ChangeRowColor(row)
        {
            //If last clicked row and the current clicked row are same
            if (previousRow == row)
                return;//do nothing
            //If there is row clicked earlier
            else if (previousRow != null)
                //change the color of the previous row back to white
                document.getElementById(previousRow).style.backgroundColor = "#ffffff";
            
            //change the color of the current row to light yellow
 
            document.getElementById(row).style.backgroundColor = "#ffffda";            
            //assign the current row id to the previous row id 
            //for next row to be clicked
            previousRow = row;
        }
     </script>

Open in new window

Murray BrownHead DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NorieAnalyst Assistant Commented:
Murray

Are you using Visual Studio or something else?
Murray BrownHead DeveloperAuthor Commented:
Hi Norie, I am using Visual Studio 2017
PANkaj KumarSoftware DeveloperCommented:
Try this

https://jsfiddle.net/tfuzwrk9/3/

<span  class="click" id="sp1">  Test for test </span><br>
<span  class="click" id="sp2">  Test for test </span><br>
<span  class="click" id="sp3">  Test for test </span><br>
<span  class="click" id="sp4">  Test for test </span><br>
<span  class="click" id="sp5">  Test for test </span><br>
<span  class="click" id="sp6">  Test for test </span><br>





<script type="text/javascript">

//variable that will store the id of the last clicked row
        var previousRow;


$(document).ready(function(){

	$(document).on('click', '.click', function(){
			 
  		var id= $(this).attr("id");
  
  		ChangeRowColor(id);
  });

});


        
        function ChangeRowColor(row)
        {
            //If last clicked row and the current clicked row are same
            if (previousRow == row)
                return;//do nothing
            //If there is row clicked earlier
            else if (previousRow != null)
                //change the color of the previous row back to white
                document.getElementById(previousRow).style.backgroundColor = "#ffffff";
            
            //change the color of the current row to light yellow
 
            document.getElementById(row).style.backgroundColor = "red";            
            //assign the current row id to the previous row id 
            //for next row to be clicked
            previousRow = row;
        }
     </script>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Get Blueprints for Increased Customer Retention

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Obadiah ChristopherDeveloper User InterfaceCommented:
A good choice would be to do it using the developer toolbar available in the popular web browsers Chrome, Firefox and IE. (F12 should bring it up)

If you still want it in ur vs code, put the keyword
debugger;

At the line u want to start debugging
jcgdCommented:
Put a breakpoint in a line of javascript and run from vs studio in debug mode using IIS Express.
Murray BrownHead DeveloperAuthor Commented:
Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.