• General
    • Home
    • Contact Us
    • Privacy Policy
    • Sitemap
  • Photographs
    • 2018
    • 2017
    • 2016
    • 2015
  • Literature
    • Poems
  • News
    • Announcements
    • Charity
    • Legal
    • Medicine
    • Politics
  • Education
    • Code Samples
      • Basic
      • Simple
      • Intermediate
      • Advanced
      • Tips
    • History
    • Literature
    • Quotes
    • Videos
    • Vocabulary
  • Entertainment
    • Art
    • Humor
    • Photos
    • Video
  • Technology
    • Software
      • Support
      • Tweaks
    • Company
    • Science
    • Security
Major Mike

Knowledge is Power - Share the Power

String Reverse [BASIC]

September 1, 2015 by GµårÐïåñ

String manipulation is one of the most basic things you need to know.

	<form id="reverse" action="javascript:doIT()">
		<table>
			<th colspan="2">Reverse String</th>
			<tr>
				<td><input type="text" id="string" placeholder="enter a string" required /></td>
			</tr>
			<tr>
				<td class="button"><input type="submit" id="reverse" value="Reverse" /></td>
			</tr>
			<tr>
				<td><strong>LOG :</strong><br/><div id="log"></div></td>
			</tr>
		</table>
	</form>
	<script>
		function doIT(){
			var string = document.getElementById("string");
			var log = document.getElementById("log");
			log.innerHTML += "&emsp;" + string.value + " = " + reversal(string.value) + "<br/>";
			string.value = reversal(string.value);
		}
		function reversal(s) {
			var r = s.split("").reverse().join("");
			return r;
		}
	</script>
DEMO | DOWNLOAD
FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail
Posted in: Basic, Education Tagged: basic level, code, JavaScript
← Ticking Bomb by Aloe Blacc
Display Sizes (Screen vs Available) [BASIC] →

Show Your Support – We Don’t Believe in Disruptive Ads

Donate in one of two ways :
(BitCoin - preferred)
1BTshbqMSx5AHrDFLEa1YdPAy5EFzRSjr9
(PayPal)
April 2021
M T W T F S S
 1234
567891011
12131415161718
19202122232425
2627282930  
« Apr    

Semper Fidelis

Always Faithful, Always Forward
United States Marine Corp

Places to find me:

StackExchange profile for GµårÐïåñ at StackExchange

CodeProject

Twitter : verified ➠Follow

GitHub ➠Follow @GuardianMajor

ello ➠

deviantArt profile for GµårÐïåñ on deviantArt

Facebook i have made a personal choice after their "name policy" witch hunt which repeats every 2 years it seems at the whim of the "bully mob" (even when they make you jump through hoops and verify you), to just quit it and be done with it, they are not worth my time. I don't need it, I don't miss it, in fact it has made my life more productive and void of gross hate, vitriol and drivel. To those who say they can't stay in touch if I am not on there, if you can't reach me because I am not on Facebook, then you are not trying AT ALL - therefore, good riddance.

Scribd profile for GµårÐïåñ on Scribd

NoScript/FLashGot (Informaction) profile for GµårÐïåñ on Informaction Forums

Subjects

1963 1948 1949 1914 1982 New York 1812 1980 holiday 1989 1863 1933 Germany 1962 vocabulary 1993 1901 1934 1915 1968 1977 1975 1955 national park 1974 event 1960 has_video 1939 code 1945 memorial 1959 1789 1976 1940 1986 1911 1889 1979 1958 1964 NASA annual 1944 1916 1957 1846 1776 1851 1991 Soviet Union history 1956 1917 United States 1978 1952 1969 1965 1859 1970 daily pic 1946 1951 1942 2000 1922 1898 has_audio England 1908 1954 1943 1865 1972 1919 1950 1935 1973 1995 1994 1983 1967 1971 1937 1981 1918 1984 1953 1961 1947 1938 1990 1870 1998 1941 1985 1902 1966

Archives

Access Options

  • Register
  • Log in
  • Entries RSS
  • Comments RSS
  • ∞ Guardian International
🎔
Brought to You
by Guardian International

Copyright © 2007-2021 Major Mike | Privacy Policy | DMCA | Contact | About
fortitudo fortis defendit

McAfee SecureNorton by SymantecVirusTotal